首页 > 代码库 > 机器学习

机器学习

from sklearn import tree
def famel():
    featre = [[178,1],[155,0],[177,0],[165,0],[169,1],[160,0]]
    lable =[‘male‘,‘female‘,‘male‘,‘female‘,‘male‘,‘female‘]
    clf = tree.DecisionTreeClassifier()
    clf = clf.fit(featre,lable)
    print(clf.predict([[158,0]]))

if __name__ == ‘__main__‘:
    famel()

机器学习