Good day Data Luminaries.
Please can anyone give the right format for submitting?
Like the way my CSV file should be structured?
I tried the conventional way but I keep getting errors
Thanks in anticipation !
The submission format is in the rules and there's a sample submission file to check. Basically it should be 2 columns. The first is the id of the user you are trying to predict and the second is the probability that they'll churn.
Your submission format should be the same as you sample submission
Pass your prediction on the test dataset into a variable
i.e
test_pred = model.predict_proba(test)[:-1]
Read you sample submission csv
sample = pd.read_csv('samplesubmission.cs')
sample['CHURN'] = test_pred
sample.to_csv('submission_file.csv', index=False)
OK Emmanuel, thanks for this
but why are we leaving out the last column
hello @imomEmmanuel am yet to submit mine
but i dont seems to understand how to go about the submission
this is the format i got
pd.DataFrame({"user_id": test["user_id"], "CHURN": pred}).to_csv("starter-submission.csv", index = False)
what should i change from this format above? thanks
@kingdafidi this is how you should go about it (thanks to @imomEmmanuel):
test_pred = model.predict_proba(test)
Read you sample submission csv(from zindi)
sample = pd.read_csv('samplesubmission.csv')
the submission sample has two columns, the user_id and CHURN
next up, replace your values in the CHURN column with the your predicted values:
then you save:
The submission format is in the rules and there's a sample submission file to check. Basically it should be 2 columns. The first is the id of the user you are trying to predict and the second is the probability that they'll churn.
Your submission format should be the same as you sample submission
Pass your prediction on the test dataset into a variable
i.e
test_pred = model.predict_proba(test)[:-1]
Read you sample submission csv
sample = pd.read_csv('samplesubmission.cs')
sample['CHURN'] = test_pred
sample.to_csv('submission_file.csv', index=False)
OK Emmanuel, thanks for this
but why are we leaving out the last column
hello @imomEmmanuel am yet to submit mine
but i dont seems to understand how to go about the submission
this is the format i got
pd.DataFrame({"user_id": test["user_id"], "CHURN": pred}).to_csv("starter-submission.csv", index = False)
what should i change from this format above? thanks
@kingdafidi this is how you should go about it (thanks to @imomEmmanuel):
Pass your prediction on the test dataset into a variable
i.e
test_pred = model.predict_proba(test)
Read you sample submission csv(from zindi)
sample = pd.read_csv('samplesubmission.csv')
the submission sample has two columns, the user_id and CHURN
next up, replace your values in the CHURN column with the your predicted values:
sample['CHURN'] = test_pred
then you save:
sample.to_csv('submission_file.csv', index=False)