我々は通常、次のような結果を得る: -Naive Bayes nltk pythonで最も有益な機能の割合はどのように計算されますか?私たちは、以下のコマンドを実行したときに
classifier.show_most_informative_features(10)
結果:
Most Informative Features
outstanding = 1 pos : neg = 13.9 : 1.0
insulting = 1 neg : pos = 13.7 : 1.0
vulnerable = 1 pos : neg = 13.0 : 1.0
ludicrous = 1 neg : pos = 12.6 : 1.0
uninvolving = 1 neg : pos = 12.3 : 1.0
astounding = 1 pos : neg = 11.7 : 1.0
を誰もが、この13.9、13.7などを計算する方法を知っていますか?
また、私たちはNaive Bayesを使った以下のメソッドclassifier.show_most_informative_features(10)で最も有益な機能を得ることができますが、ロジスティック回帰を使用して同じ結果を得たい場合は、誰かがそれを得る方法を提案することができます。私はstackoverflow上の1つのポストを見たが、それは私が機能を作成するために使用していないベクトルが必要です。
classifier = nltk.NaiveBayesClassifier.train(train_set)
print("Original Naive bayes accuracy percent: ", nltk.classify.accuracy(classifier,dev_set)* 100)
classifier.show_most_informative_features(10)
LogisticRegression_classifier = SklearnClassifier(LogisticRegression())
LogisticRegression_classifier.train(train_set)
print("LogisticRegression accuracy percent: ", nltk.classify.accuracy(LogisticRegression_classifier, dev_set)*100)
何か助けてください... ............................ – user3222101