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

Function get_w

SVM/svm-simple.py:259–262  ·  view source on GitHub ↗
(dataMat, labelMat, alphas)

Source from the content-addressed store, hash-verified

257 2017-09-23
258"""
259def get_w(dataMat, labelMat, alphas):
260 alphas, dataMat, labelMat = np.array(alphas), np.array(dataMat), np.array(labelMat)
261 w = np.dot((np.tile(labelMat.reshape(1, -1).T, (1, 2)) * dataMat).T, alphas)
262 return w.tolist()
263
264
265if __name__ == '__main__':

Callers 1

svm-simple.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected