MCPcopy Index your code
hub / github.com/scikit-learn/scikit-learn / predict

Method predict

sklearn/multioutput.py:288–310  ·  view source on GitHub ↗

Predict multi-output variable using model for each target variable. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) The input data. Returns ------- y : {array-like, sparse matrix} of shape (n_samples

(self, X)

Source from the content-addressed store, hash-verified

286 return self
287
288 def predict(self, X):
289 """Predict multi-output variable using model for each target variable.
290
291 Parameters
292 ----------
293 X : {array-like, sparse matrix} of shape (n_samples, n_features)
294 The input data.
295
296 Returns
297 -------
298 y : {array-like, sparse matrix} of shape (n_samples, n_outputs)
299 Multi-output targets predicted across multiple predictors.
300 Note: Separate models are generated for each predictor.
301 """
302 check_is_fitted(self)
303 if not hasattr(self.estimators_[0], "predict"):
304 raise ValueError("The base estimator should implement a predict method")
305
306 y = Parallel(n_jobs=self.n_jobs)(
307 delayed(e.predict)(X) for e in self.estimators_
308 )
309
310 return np.asarray(y).T
311
312 def __sklearn_tags__(self):
313 tags = super().__sklearn_tags__()

Callers

nothing calls this directly

Calls 3

check_is_fittedFunction · 0.90
ParallelClass · 0.90
delayedFunction · 0.90

Tested by

no test coverage detected