MCPcopy Index your code
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / loadDataSet

Function loadDataSet

Logistic regression/Logistic.py:4–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2from numpy import *
3
4def loadDataSet():
5 dataMat = []; labelMat = []
6 fr = open('testSet.txt')
7 for line in fr.readlines():
8 lineArr = line.strip().split()
9 dataMat.append([1.0, float(lineArr[0]), float(lineArr[1])])
10 labelMat.append(int(lineArr[2]))
11 return dataMat, labelMat
12
13def sigmoid(inX):
14 return 1/(1+exp(-inX))

Callers 2

plotBestFitFunction · 0.70
Logistic.pyFile · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected