_SklearnAdapter

class _SklearnAdapter(regressor: sklearn.base.RegressorMixin)[source]

Bases: etna.models.base.BaseAdapter

Inherited-members

Parameters

regressor (sklearn.base.RegressorMixin) –

Methods

fit(df, regressors)

Fit Sklearn model.

get_model()

Get internal sklearn model that is used inside etna class.

predict(df)

Compute predictions from a Sklearn model.

predict_components(df)

Estimate prediction components.

fit(df: pandas.core.frame.DataFrame, regressors: List[str]) etna.models.sklearn._SklearnAdapter[source]

Fit Sklearn model.

Parameters
  • df (pandas.core.frame.DataFrame) – Features dataframe

  • regressors (List[str]) – List of the columns with regressors

Returns

Fitted model

Return type

etna.models.sklearn._SklearnAdapter

get_model() sklearn.base.RegressorMixin[source]

Get internal sklearn model that is used inside etna class.

Returns

Internal model

Return type

sklearn.base.RegressorMixin

predict(df: pandas.core.frame.DataFrame) numpy.ndarray[source]

Compute predictions from a Sklearn model.

Parameters

df (pandas.core.frame.DataFrame) – Features dataframe

Returns

Array with predictions

Return type

numpy.ndarray

predict_components(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Estimate prediction components.

Parameters

df (pandas.core.frame.DataFrame) – features dataframe

Returns

dataframe with prediction components

Return type

pandas.core.frame.DataFrame