naive bayes classifier dynamic training
问题 Is it possible (and how if it is) to dynamically train sklearn MultinomialNB Classifier? I would like to train(update) my spam classifier every time I feed an email in it. I want this (does not work): x_train, x_test, y_train, y_test = tts(features, labels, test_size=0.2) clf = MultinomialNB() for i in range(len(x_train)): clf.fit([x_train[i]], [y_train[i]]) preds = clf.predict(x_test) to have similar result as this (works OK): x_train, x_test, y_train, y_test = tts(features, labels, test