please am done with the prediciting of the train data. but i dont know how to export it and make submission with the format. please i need help over here... Thanks in anticipation guys
When you finish your predictions all you have to do is create a new CSV file with 2 columns. The first column is for the userID the second column is your official probability.
You can import the sample submission CSV that's part of the and just overwrite it's second column with your predicted values.
When you finish your predictions all you have to do is create a new CSV file with 2 columns. The first column is for the userID the second column is your official probability.
You can import the sample submission CSV that's part of the and just overwrite it's second column with your predicted values.
please can you help me out with the format please?
First you'll need the userIDs you can extract that from the test data set using
YourSubmission = pd.DataFrame(dftest["user_id"])
Then you'll need to assign your predicted probability to the second column called "CHURN". I did that using
YourSubmission["CHURN"] = prediction_proba[:,1]
where prediction_proba is my predicted probability and the index at the end extracts the second column.
Finally you need to save the "YourSubmission" dataframe to CSV. I did that using
YourSubmission.to_csv("YourSubmission.csv",sep=",",index=False)
Index= False ensures the CSV file doesn't save the index column.
waoooo .. thanks for the help
so after doing all this now cause have done it
is it the same notebook am submitting ?
No. You just submit the CSV file.