MCPcopy
hub / github.com/apachecn/ailearning / loadDataSet

Function loadDataSet

src/python/13.PCA/pca.py:15–19  ·  view source on GitHub ↗
(fileName, delim='\t')

Source from the content-addressed store, hash-verified

13
14
15def loadDataSet(fileName, delim='\t'):
16 fr = open(fileName)
17 stringArr = [line.strip().split(delim) for line in fr.readlines()]
18 datArr = [map(float, line) for line in stringArr]
19 return mat(datArr)
20
21
22def pca(dataMat, topNfeat=9999999):

Callers 1

replaceNanWithMeanFunction · 0.70

Calls 1

mapFunction · 0.85

Tested by

no test coverage detected