MCPcopy Index your code
hub / github.com/rushter/MLAlgorithms / fit

Method fit

mla/svm/svm.py:40–47  ·  view source on GitHub ↗
(self, X, y=None)

Source from the content-addressed store, hash-verified

38 self.K = None
39
40 def fit(self, X, y=None):
41 self._setup_input(X, y)
42 self.K = np.zeros((self.n_samples, self.n_samples))
43 for i in range(self.n_samples):
44 self.K[:, i] = self.kernel(self.X, self.X[i, :])
45 self.alpha = np.zeros(self.n_samples)
46 self.sv_idx = np.arange(0, self.n_samples)
47 return self._train()
48
49 def _train(self):
50 iters = 0

Callers 9

test_svm_classificationFunction · 0.95
classificationFunction · 0.95
trainMethod · 0.45
test_linearFunction · 0.45
test_knnFunction · 0.45
test_linear_modelFunction · 0.45
test_random_forestFunction · 0.45
test_knnFunction · 0.45
test_PCAFunction · 0.45

Calls 2

_trainMethod · 0.95
_setup_inputMethod · 0.80

Tested by 7

test_svm_classificationFunction · 0.76
test_linearFunction · 0.36
test_knnFunction · 0.36
test_linear_modelFunction · 0.36
test_random_forestFunction · 0.36
test_knnFunction · 0.36
test_PCAFunction · 0.36