kps (6) [Avatar] Offline
#1
Are the following statements missing in the sample code?
movies['sentiment_ispositive'] = (movies.sentiment > 0).astype(int)
movies['predicted_ispositive'] = nb.predict(df_bows.values).astype(int)

Otherwise the following statement will fail, because the columns are not there!
movies['sentiment predicted_sentiment sentiment_ispositive predicted_ispositive'.split()].head(8)


These statements are provided in the sample on the following page (products).

In the products sample on page 53 there seem to be mismatches on the naming of the various data frames?