I'm new to scikit-learn, I'm trying to create a Multinomial Bayes model to predict movies box office. Below is just a toy example, I'm not sure if it is logically correct (suggestions are welcome!). The Y's corresponds to the estimate gross I'm trying to predict (1: <...
importrandomfromsklearnimportcross_validationfromsklearn.naive_bayesimportMultinomialNBdefmultinomial_nb_with_cv(x_train, y_train): random.shuffle(X) kf = cross_validation.KFold(len(X), n_folds=10) acc = []fortrain_index, test_indexinkf: y_true = y_train[test_index] clf ...