sklearn_regression#


class SkLearnRandomForestVectorRegressionModel(n_estimators=100, min_samples_leaf=10, random_state=42, **model_args)[source]#

Bases: AbstractSkLearnMultipleOneDimVectorRegressionModel, FeatureImportanceProviderSkLearnRegressionMultipleOneDim

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

class SkLearnLinearRegressionVectorRegressionModel(fit_intercept=True, **model_args)[source]#

Bases: AbstractSkLearnMultiDimVectorRegressionModel, FeatureImportanceProviderSkLearnRegressionMultiDim

Parameters:
class SkLearnLinearRidgeRegressionVectorRegressionModel(alpha=1.0, fit_intercept=True, solver='auto', max_iter=None, tol=0.001, **model_args)[source]#

Bases: AbstractSkLearnMultiDimVectorRegressionModel, FeatureImportanceProviderSkLearnRegressionMultiDim

Linear least squares with L2 regularisation

Parameters:
class SkLearnLinearLassoRegressionVectorRegressionModel(alpha=1.0, fit_intercept=True, max_iter=1000, tol=0.0001, **model_args)[source]#

Bases: AbstractSkLearnMultiDimVectorRegressionModel, FeatureImportanceProviderSkLearnRegressionMultiDim

Linear least squares with L1 regularisation, a.k.a. the lasso

Parameters:
class SkLearnMultiLayerPerceptronVectorRegressionModel(hidden_layer_sizes=(100,), activation: str = 'relu', solver: str = 'adam', batch_size: Union[int, str] = 'auto', random_state: Optional[int] = 42, max_iter: int = 200, early_stopping: bool = False, n_iter_no_change: int = 10, **model_args)[source]#

Bases: AbstractSkLearnMultiDimVectorRegressionModel

Parameters:
  • hidden_layer_sizes – the sequence of hidden layer sizes

  • activation – {“identity”, “logistic”, “tanh”, “relu”} the activation function to use for hidden layers (the one used for the output layer is always ‘identity’)

  • solver – {“adam”, “lbfgs”, “sgd”} the name of the solver to apply

  • batch_size – the batch size or “auto” for min(200, data set size)

  • random_state – the random seed for reproducability; use None if it shall not be specifically defined

  • max_iter – the number of iterations (gradient steps for L-BFGS, epochs for other solvers)

  • early_stopping – whether to use early stopping (stop training after n_iter_no_change epochs without improvement)

  • n_iter_no_change – the number of iterations after which to stop early (if early_stopping is enabled)

  • model_args – additional arguments to pass on to MLPRegressor, see https://scikit-learn.org/stable/modules/generated/sklearn.neural_network.MLPRegressor.html

class SkLearnSVRVectorRegressionModel(**model_args)[source]#

Bases: AbstractSkLearnMultiDimVectorRegressionModel

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

class SkLearnLinearSVRVectorRegressionModel(**model_args)[source]#

Bases: AbstractSkLearnMultiDimVectorRegressionModel

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

class SkLearnGradientBoostingVectorRegressionModel(random_state=42, **model_args)[source]#

Bases: AbstractSkLearnMultipleOneDimVectorRegressionModel

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

class SkLearnKNeighborsVectorRegressionModel(**model_args)[source]#

Bases: AbstractSkLearnMultiDimVectorRegressionModel

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

class SkLearnExtraTreesVectorRegressionModel(n_estimators=100, min_samples_leaf=10, random_state=42, **model_args)[source]#

Bases: AbstractSkLearnMultipleOneDimVectorRegressionModel

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

class SkLearnDummyVectorRegressionModel(strategy='mean', constant=None, quantile=None)[source]#

Bases: AbstractSkLearnMultipleOneDimVectorRegressionModel

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

class SkLearnDecisionTreeVectorRegressionModel(random_state=42, **model_args)[source]#

Bases: AbstractSkLearnMultipleOneDimVectorRegressionModel

Parameters:
  • model_constructor – the sklearn model constructor

  • model_args – arguments to be passed to the sklearn model constructor

plot(predicted_var_name=None, figsize=None) Figure[source]#
plot_graphviz_pdf(dot_path, predicted_var_name=None)[source]#
Parameters:
  • path – the path to a .dot file that will be created, alongside which a rendered PDF file (with added suffix “.pdf”) will be placed

  • predicted_var_name – the predicted variable name for which to plot the model (if multiple; None is admissible if there is only one predicted variable)