MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / _loss

Method _loss

svm_class/svm_smo.py:43–47  ·  view source on GitHub ↗
(self, X, Y)

Source from the content-addressed store, hash-verified

41 self.C = C
42
43 def _loss(self, X, Y):
44 # return -np.sum(self.alphas) + \
45 # 0.5 * np.sum(np.outer(Y, Y) * self.kernel(X, X) * np.outer(self.alphas, self.alphas))
46 return -np.sum(self.alphas) + \
47 0.5 * np.sum(self.YYK * np.outer(self.alphas, self.alphas))
48
49 def _take_step(self, i1, i2):
50 # returns True if model params changed, False otherwise

Callers 2

_take_stepMethod · 0.95
fitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected