MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / _predict

Method _predict

machine_learning/sequential_minimum_optimization.py:206–217  ·  view source on GitHub ↗
(self, sample)

Source from the content-addressed store, hash-verified

204
205 # Predict tag for test sample
206 def _predict(self, sample):
207 k = self._k
208 predicted_value = (
209 np.sum(
210 [
211 self.alphas[i1] * self.tags[i1] * k(i1, sample)
212 for i1 in self._all_samples
213 ]
214 )
215 + self._b
216 )
217 return predicted_value
218
219 # Choose alpha1 and alpha2
220 def _choose_alphas(self):

Callers 1

predictMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected