Dummy

class sklego.dummy.RandomRegressor(strategy='uniform', random_state=None)[source]

Bases: sklearn.base.BaseEstimator, sklearn.base.RegressorMixin

A RandomRegressor makes random predictions only based on the “y” value that is seen. The goal is that such a regressor can be used for benchmarking. It should be easily beatable.

Parameters:
  • strategy (str) – how we want to select random values, can be “uniform” or “normal”

  • seed (int) – the seed value, default: 42

fit(X: numpy.array, y: numpy.array) sklego.dummy.RandomRegressor[source]

Fit the model using X, y as training data.

Parameters:
  • X – array-like, shape=(n_columns, n_samples,) training data.

  • y – array-like, shape=(n_samples,) training data.

Returns:

Returns an instance of self.

predict(X)[source]

Predict new data by making random guesses.

Parameters:

X – array-like, shape=(n_columns, n_samples,) training data.

Returns:

array, shape=(n_samples,) the predicted data