Skip to content

Instantly share code, notes, and snippets.

@mxposed
Created December 30, 2016 16:34
Show Gist options
  • Save mxposed/aef6084a34888ab639d5b84b4cb0ce9d to your computer and use it in GitHub Desktop.
Save mxposed/aef6084a34888ab639d5b84b4cb0ce9d to your computer and use it in GitHub Desktop.
# сохранить предсказания в переменную predictions
predictions = clf.predict(test_input)
# создать из предсказаний объект DataFrame (и назвать колонку в нём Label) и сохранить в переменную predictions_df
predictions_df = pd.DataFrame(predictions, columns=['Label'])
# обозвать индексную колонку ImageId
predictions_df.index.name = 'ImageId'
# записать в файлик
predictions_df.to_csv('my_super_predictions.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment