machine learning - Sklearn for Python: Is there a way to see how close a prediction was? -
i using code perform predictions classify text: predicted = clf.predict(x_new_tfidf) my predictions either come out saying text snippet belongs subject or subject b. however, want further analysis on predictions shaky -- is, if model unsure whether or b, had pick 1 sake of it. there way extract relative confidence of predictions? code: x_train has ["sentence know belongs subject a", "another sentence describes subject a", "a sentence subject b", "another sentence subject b"...] , etc y_train contains corresponding classifiers: ["subject a", "subject a", "subject b", "subject b", ...] , etc. predict_these_x list of sentences wish classify: ["some random sentence", "another sentence", "another sentence again", ...] etc. count_vect = countvectorizer() tfidf_transformer = tfidftransformer() x_train_counts = count_vect.fit_transform(x_train) x_...