MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / _k

Method _k

machine_learning/sequential_minimum_optimization.py:171–177  ·  view source on GitHub ↗
(self, i1, i2)

Source from the content-addressed store, hash-verified

169
170 # Get value calculated from kernel function
171 def _k(self, i1, i2):
172 # for test samples, use kernel function
173 if isinstance(i2, np.ndarray):
174 return self.Kernel(self.samples[i1], i2)
175 # for training samples, kernel values have been saved in matrix
176 else:
177 return self._K_matrix[i1, i2]
178
179 # Get error for sample
180 def _e(self, index):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected