一个简易的KNN
#代码参考机器学习实践(Machine Learning in Action)
from numpy import *
import operator #运算符模块
import matplotlib.pyplot as plt
def createDataset():
group = array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]])
labels = ['A','A','B','B']
return group, labels
def p.
原创
2021-04-08 20:01:23 ·
180 阅读 ·
0 评论