#结果展示 ''' 数据集展示: labels messages 0 0 Go until jurong point, crazy.. Available only ... 1 0 Ok lar... Joking wif u oni... 2 1 Free entry in 2 a wkly comp to win FA Cup fina... 3 0 U dun say so early hor... U c already then say... 4 0 Nah I don't think he goes to usf, he lives aro... ... ... ... 5567 1 This is the 2nd time we have tried 2 contact u... 5568 0 Will ü b going to esplanade fr home? 5569 0 Pity, * was in mood for that. So...any other s... 5570 0 The guy did some bitching but I acted like i'd... 5571 0 Rofl. Its true to its name

[5572 rows x 2 columns]


多项式模型的预测结果,类型,长度: [0 0 0 ... 0 0 1] <class 'numpy.ndarray'> (1115,) 多项式模型的前一百个预测结果: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 多项式模型模型R²评分:0.9820627802690582


伯努利模型的预测结果,类型,长度: [0 0 0 ... 0 0 1] <class 'numpy.ndarray'> (1115,) 伯努利模型的前一百个预测结果: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 伯努利模型R²评分:0.9847533632286996 ''

from sklearnnaive_bayes import BernoulliNBMultinomialNBfrom sklearnfeature_extractiontext import CountVectorizerfrom sklearnmodel_selection import train_test_splitimport pandas as pdpath = EPython_fil

原文地址: http://www.cveoy.top/t/topic/fESM 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录