[python]k-近邻算法

2016-6-7 写技术

书上把kNN抄了一遍,跑起来爽爽的: from numpy import * import operator 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 classify0(inX, dataSet, labels, k): dataSetSize = dataSet.shape[0] diffMat = tile(inX, (dataSetSize, ...

阅读全文>>

标签: python machine_learning

评论(0) 浏览(1554)

[python]ubuntu下python安装指南

2016-3-30 写技术

1.下载地址:python.org 2.解压 tar -xzvf ******.tgz 3.配置 ./configure --prefix=${pwd} 4.编译 make 5.安装 sudo make install 6.将安装目录(当前pwd)加到环境 /etc/environment 7.我还只会重启生效

阅读全文>>

标签: python

评论(0) 浏览(1544)

Powered by anycle 湘ICP备15001973号-1