Skip to content
ml-recall

#scikit-learn-api

1 question from Data & Features

Timed test

1 question · 1 min · score and explanations at the end

Take a test
Q 1 / 1Score 0 / 0

Question 1: Single choice

mediumAI-checkedData & Features

What happens when this code runs?

import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin

class Centerer(TransformerMixin, BaseEstimator):
    def fit(self, X, y=None):
        self.mean_ = X.mean(axis=0)      # no return statement

    def transform(self, X):
        return X - self.mean_

X = np.array([[1.0, 2.0], [3.0, 6.0]])
print(Centerer().fit_transform(X))
Choose one option