a3cf2e0e4113039
http://nhiro.org.s3.amazonaws.com/9/2/928bb881b2f6e6b1a23deb72f60c4d28.jpg https://gyazo.com/928bb881b2f6e6b1a23deb72f60c4d28
(OCR text)
正解データを読んでLRを学習
40
fileyes
codecs.open ( 'XXX. txt',
codecs.open ('not XXX.txt',
'utf-8')
file no
'r',
'utf-8')
XS
for line in file_yes:
ys
1
line
preprocess (line)
xs.append (make feature vector (line))
ys.append (1)
for line in file no:
preprocess (line)
xs.append (makefeature_vector (line))
line
ys.append (0)
from sklearn.linear_model import LogisticRegression
LogisticRegression ()
model
model.fit (xs, ys)