摘要: #coding:utf-8 from numpy import * def loaddata(): datamat=[] label=[] fr=open("testSet.txt") for line in fr.readlines(): arr=line.strip().split() datamat.append([1.0,f... 阅读全文
posted @ 2017-06-08 22:04 semen 阅读(257) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8 from numpy import * import re def createlist(lst):#将所有文本放入一个列表中 listt=set([]) for line in lst: listt=listt|set(line) return list(listt) def word2vec(List,inputset):#... 阅读全文
posted @ 2017-06-08 15:12 semen 阅读(327) 评论(0) 推荐(0) 编辑