2019年9月24日

k-近邻算法(kNN)完整代码

摘要: 1 from numpy import *#科学计算包 2 from numpy import tile 3 from numpy import zeros 4 import operator #运算符模块 5 import importlib 6 import sys 7 importlib.reload(sys) 8 9 def createDataSet(): 10 group = arra 阅读全文

posted @ 2019-09-24 17:21 柒~年 阅读(1908) 评论(0) 推荐(0)

k-近邻算法(kNN)测试算法:作为完整程序验证分类器

摘要: 输入命令:kNN.datingClassTest() 阅读全文

posted @ 2019-09-24 16:58 柒~年 阅读(551) 评论(0) 推荐(0)

kNN#约会网站预测数据

摘要: 1 #约会网站预测数据 2 def classifyPersion(): 3 resultList = ['not at all','in small doses','in large doses'] 4 #input()函数允许用户输入文本行命令并返回用户所输入的命令 5 percentTats = float(input("percentage of time spent playing vi 阅读全文

posted @ 2019-09-24 16:57 柒~年 阅读(285) 评论(0) 推荐(0)

导航