MCPcopy Create free account
hub / github.com/Jack-Cherish/Machine-Learning / __init__

Method __init__

SVM/svm-smo.py:26–34  ·  view source on GitHub ↗
(self, dataMatIn, classLabels, C, toler)

Source from the content-addressed store, hash-verified

24 toler - 容错率
25 """
26 def __init__(self, dataMatIn, classLabels, C, toler):
27 self.X = dataMatIn #数据矩阵
28 self.labelMat = classLabels #数据标签
29 self.C = C #松弛变量
30 self.tol = toler #容错率
31 self.m = np.shape(dataMatIn)[0] #数据矩阵行数
32 self.alphas = np.mat(np.zeros((self.m,1))) #根据矩阵行数初始化alpha参数为0
33 self.b = 0 #初始化b参数为0
34 self.eCache = np.mat(np.zeros((self.m,2))) #根据矩阵行数初始化虎误差缓存,第一列为是否有效的标志位,第二列为实际的误差E的值。
35
36def loadDataSet(fileName):
37 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected