def data2Vector(self):
vec = DictVectorizer()
dummy_x = vec.fit_transform(self.feature_list).toarray()
lb = LabelBinarizer()
dummy_y = lb.fit_transform(self.label_list)
return dummy_x, dummy_y
# here the decision tree use the algorithm which we call ID3, ID3 will use
# information gain as feature select
评论列表
文章目录