- 博客(3)
- 收藏
- 关注
原创 Machine Learning in Action_CH2_3_使用kNN手写数字识别
from numpy import * import operator from os import listdir # kNN def classify0(inX, dataSet, labels, k): dataSetSize = dataSet.shape[0] # 获得向量第一维长度 diffMat = tile(inX, (dataSetSize, 1)) - dat
2017-04-27 15:48:19 299
原创 Machine Learning in Action_CH2_2_使用kNN改进约会网站的配对效果
from numpy import * import operator # 创建数据 def createDataBase(): group = array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]]) # numpy向量 labels = ['A', 'A', 'B', 'B'] # 列表 return group, label
2017-04-27 08:56:38 362
原创 Machine Learning in Action_CH2_1_kNN
from numpy import * import operator def createDataBase(): group = array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]]) labels = ['A', 'A', 'B', 'B'] return group, labels def classify0(inX,
2017-04-19 21:30:06 259
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人