Skip to content

Instantly share code, notes, and snippets.

@abhishek-shrm
Last active September 23, 2020 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhishek-shrm/4d53b1f9f90b8959779e6810db7148a3 to your computer and use it in GitHub Desktop.
Save abhishek-shrm/4d53b1f9f90b8959779e6810db7148a3 to your computer and use it in GitHub Desktop.
# Making final predictions
final_pred=model.predict(test_seq)
# Creating dataframe for final probabilties
prob=pd.DataFrame(columns=['id','toxic','severe_toxic','obscene','threat','insult','identity_hate'])
prob['id']=df_test['id']
# Populating dataframe with probabilities
for index,value in enumerate(['toxic','severe_toxic','obscene','threat','insult','identity_hate']):
prob[value]=final_pred[:,index]
# Saving predictions as CSV
prob.to_csv('submission-CNN-final.csv',index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment