I noticed that after each time I execute the following lines of code, my results are different. Any idea why? I think that the main issue here is this line of code But I dont understand why?
test_data['prediction']=sentiment_model.predict_proba(test_matrix)[:,0]
What is the best way to add new column with .predict_prob()?
test_data['prediction'] = sentiment_model.predict_proba(test_matrix)[:,0]
test_data['prediction_label'] = sentiment_model.predict(test_matrix)
test_data['prediction'] = test_data['prediction'].apply(lambda x: round(x,2))
test_data.sort_values(by='prediction', ascending=False, inplace=True)
test_data[test_data['name'] == 'Britax Decathlon Convertible Car Seat, Tiffany']
test_data.head()