Your score for this submission is:0.0. Your Leaderboard score is: 0.0


#1

can any any one help me with this? i am getting 0 score in leaderboard where my code seems to be fine.

is anything wrong with the submission format?

submission = pd.DataFrame({
“Loan_ID”: df_test[“Loan_ID”],
“Loan_Status”: pred
})
submission.to_csv(’/resources/data/Loan prediction/Sample_Submission.csv’,sep=’,’, index=False)


#2

Hi @hawk9,

Please post the first five rows of your submission file


#3

LP001015 Yes
LP001022 Yes
LP001031 Yes
LP001035 Yes
LP001051 Yes


#4

You submission file should include columns names, and should be comma separated.

It should look like this

Loan_ID,Loan_Status
LP001015,Y
LP001022,Y
LP001031,Y
LP001035,Y
LP001051,Y

Also, the file should be of 368 lines


#5

here is my submission code:

submission = pd.DataFrame({
“Loan_ID”: df_test[“Loan_ID”],
“Loan_Status”: pred
})
submission.to_csv(’/resources/data/Loan prediction/Sample_Submission.csv’,sep=’,’, index=False)

as you can see i have used the ‘sep’ parameter to separate the features using comma and i also have 368 lines, but still it seems i am getting the same problem.

when i run the below lines:

import csv
with open(’/resources/data/Loan prediction/Sample_Submission.csv’) as f:
reader = csv.reader(f)
your_list = list(reader)

print (your_list)

i get:

[[‘Loan_ID’, ‘Loan_Status’], [‘LP001015’, ‘Yes’], [‘LP001022’, ‘Yes’], [‘LP001031’, ‘Yes’], [‘LP001035’, ‘Yes’], [‘LP001051’, ‘Yes’], [‘LP001054’, ‘Yes’], [‘LP001055’, ‘Yes’], [‘LP001056’, ‘No’], [‘LP001059’, ‘Yes’], [‘LP001067’, ‘Yes’], [‘LP001078’, ‘Yes’], [‘LP001082’, ‘No’], [‘LP001083’, ‘Yes’], [‘LP001094’, ‘No’],…]


#6

I should have been more clear.

Did you notice that in the correct format, the Loan_Status column should have values as “Y” and “N” and not “Yes” and “No”?


#7

@jalFaizy

Ok, i think my code is not doing as expected.

x_train= df.drop([‘Loan_Status’,‘Loan_ID’], axis=1)
y_train=df[‘Loan_Status’]
x_test=df_test.drop([‘Loan_ID’],axis=1)

random_forest = RandomForestClassifier(n_estimators=100)
random_forest.fit(x_train, y_train)
pred = random_forest.predict(x_test)
random_forest.score(x_train, y_train)

according to the code the ‘pred’ should return ‘Loan_Status’ but it seems it is returning something else (‘Married’/‘Self_Employed’). could you please check where am i going wrong?


#8

Take a look at a sample solution and see if it helps


#9

Ok so my score is 0.784722 now after somehow modifying the code. I have obtained the EMI and ratio(EMI/Total income). Could you advice how can i improve my score?


#10

Although a generic advice, you should look at ensemble methods for modelling. Another thing would be creating more features as EMI that you have created.

I would recommend you to refer the discussions that have already happened and gain ideas from it


#11

@jalFaizy how can we convert array of predictions of 0/1 into y/n for correct submission for the problem?


#12

You can simply do it by making a one-to-one correspondence with these values.

For example,
you assign 0 to N, and 1 to Y.

But do make sure you stick to these assignments till the end and not deviate from it


#13

Hi, just wondering where to check the scores. I just submitted my first file but did not see any messages for scores. Thanks.