MCPcopy Index your code
hub / github.com/ddbourgin/numpy-ml / fit

Method fit

numpy_ml/nonparametric/kernel_regression.py:40–51  ·  view source on GitHub ↗

Fit the regression model to the data and targets in `X` and `y`. Parameters ---------- X : :py:class:`ndarray ` of shape `(N, M)` An array of N examples to generate predictions on y : :py:class:`ndarray ` of shape `(

(self, X, y)

Source from the content-addressed store, hash-verified

38 self.kernel = KernelInitializer(kernel)()
39
40 def fit(self, X, y):
41 """
42 Fit the regression model to the data and targets in `X` and `y`.
43
44 Parameters
45 ----------
46 X : :py:class:`ndarray <numpy.ndarray>` of shape `(N, M)`
47 An array of N examples to generate predictions on
48 y : :py:class:`ndarray <numpy.ndarray>` of shape `(N, ...)`
49 Predicted targets for the `N` rows in `X`
50 """
51 self.parameters = {"X": X, "y": y}
52
53 def predict(self, X):
54 """

Callers 1

plot_regressionFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected