資源簡介
數據挖掘常用算法代碼實現
代碼片段和文件信息
from?numpy?import?*
import?matplotlib.pyplot?as?plt
def?loadDataSet(fileName):??????#general?function?to?parse?tab?-delimited?floats
????dataMat?=?[]????????????????#assume?last?column?is?target?value
????fr?=?open(fileName)
????for?line?in?fr.readlines():
????????curLine?=?line.strip().split(‘\t‘)
????????fltLine?=?map(floatcurLine)?#map?all?elements?to?float()
????????dataMat.append(fltLine)
????return?dataMat
def?distEclud(vecA?vecB):
????return?sqrt(sum(power(vecA?-?vecB?2)))?#la.norm(vecA-vecB)
def?randCent(dataSet?k):
????n?=?shape(dataSet)[1]
????centroids?=?mat(zeros((kn)))#create?centroid?mat
????for?j?in?range(n):#create?random?cluster?centers?within?bounds?of?each?dimension
????????minJ?=?min(array(dataSet)[:j])
????????
????????rangeJ?=?float(max(array(dataSet)[:j])?-
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3225??2016-02-20?09:33??數據挖掘常用算法+代碼+數據\K-maeans\K-means.py
?????文件????????302??2016-02-20?12:52??數據挖掘常用算法+代碼+數據\K-maeans\Readme.txt
?????文件??????19472??2014-09-25?20:34??數據挖掘常用算法+代碼+數據\K-maeans\testSet.txt
?????文件???????1737??2016-02-20?13:46??數據挖掘常用算法+代碼+數據\KNN\knn.py
?????文件????????312??2016-02-20?14:03??數據挖掘常用算法+代碼+數據\KNN\Readme.txt
?????文件???????3788??2010-11-01?15:09??數據挖掘常用算法+代碼+數據\LogisticRegression\horseColicTest.txt
?????文件??????60655??2010-11-01?14:56??數據挖掘常用算法+代碼+數據\LogisticRegression\horseColicTraining.txt
?????文件???????6402??2016-02-20?14:43??數據挖掘常用算法+代碼+數據\LogisticRegression\lr.py
?????文件???????7090??2016-02-20?14:43??數據挖掘常用算法+代碼+數據\LogisticRegression\lr.pyc
?????文件????????549??2016-02-20?14:41??數據挖掘常用算法+代碼+數據\LogisticRegression\LRClassifier150.json
?????文件???????1977??2016-02-20?14:45??數據挖掘常用算法+代碼+數據\LogisticRegression\main.py
?????文件???????2723??2016-02-20?14:43??數據挖掘常用算法+代碼+數據\LogisticRegression\ob
?????文件???????3789??2016-02-20?14:43??數據挖掘常用算法+代碼+數據\LogisticRegression\ob
?????文件????????435??2016-02-20?14:50??數據挖掘常用算法+代碼+數據\LogisticRegression\Readme.txt
?????文件????????381??2014-11-03?17:02??數據挖掘常用算法+代碼+數據\PageRank\changeT.m
?????文件????????326??2016-02-20?10:40??數據挖掘常用算法+代碼+數據\PageRank\data.mat
?????文件????????376??2016-02-20?10:44??數據挖掘常用算法+代碼+數據\PageRank\main.m
?????文件????????395??2014-11-10?17:35??數據挖掘常用算法+代碼+數據\PageRank\PageRank.m
?????文件????????333??2016-02-20?10:52??數據挖掘常用算法+代碼+數據\PageRank\Readme.txt
?????文件????????670??2016-02-20?14:09??數據挖掘常用算法+代碼+數據\RandomForest\data\out.csv
?????文件???????2958??2015-11-24?20:47??數據挖掘常用算法+代碼+數據\RandomForest\data\test_x.csv
?????文件??????13282??2016-02-20?14:09??數據挖掘常用算法+代碼+數據\RandomForest\data\train_x.csv
?????文件???????2245??2016-02-20?14:09??數據挖掘常用算法+代碼+數據\RandomForest\data\train_y.csv
?????文件????????840??2016-02-20?14:13??數據挖掘常用算法+代碼+數據\RandomForest\randomforest.py
?????文件????????393??2016-02-20?14:16??數據挖掘常用算法+代碼+數據\RandomForest\Readme.txt
?????文件????????346??2016-02-20?12:36??數據挖掘常用算法+代碼+數據\SVM\Readme.txt
?????文件???????1564??2016-02-20?12:30??數據挖掘常用算法+代碼+數據\SVM\svm.m
?????文件??????20168??2010-01-30?18:38??數據挖掘常用算法+代碼+數據\SVM\wine.mat
?????文件??????25590??2005-08-06?20:13??數據挖掘常用算法+代碼+數據\WEKA和SPSS的數據集\SPSS數據集\data02-01.sav
?????文件????????659??2004-03-18?08:34??數據挖掘常用算法+代碼+數據\WEKA和SPSS的數據集\SPSS數據集\data02-02.sav
............此處省略183個文件信息
- 上一篇:軟件測試實驗作業題目5道 湖北經濟
- 下一篇:易語言硬盤鎖源碼附帶教程.zip
評論
共有 條評論