【发布时间】:2018-10-31 22:08:08
【问题描述】:
x=dataset1[:,1:23] # features
y=dataset1[:,0] #classtypes
xtrain, xtest, ytrain, ytest = train_test_split(x, y, test_size=0.20)
我的数据集只有字母。 1 行有 23 个字母。 第一个字母是classtype,其他字母是feauters。我有 2 节课 --> a,z
示例:a,b,c,d,e,...,g
我会先计算召回率、精度和其他值。我需要找到 ypred 导致这些值询问 2 个参数(ytest,ypred) 。 如何使用朴素贝叶斯预测数据?
【问题讨论】:
-
你使用了什么算法?来自 sklearn 的 GaussianNB?
-
从 nltk.classify 导入 NaiveBayesClassifier 从 nltk.classify.scikitlearn 导入 SklearnClassifier 。并与 . nc = NaiveBayesClassifier.train(train1)。 Train1 是我数据集的 3/4
标签: machine-learning nltk predict naivebayes