Regression

Performs model training, testing, evaluations and deployment

deploy_model(estimator_name, host='localhost', port=8000)[source]
estimator_namestr

Name of the estimator to be deployed

host{str, IPv4 or IPv6}, default=’localhost’

Hostname or IP address of the machine where the API will be deployed

portint, default=8000

API listening port

get_estimators(multi_output=False, multi_task=False, names_only=True)[source]

Returns the list of available regression estimators

multi_outputbool, default=False

Future use

multi_taskbool, default=False

Future use

names_onlybool, default=True

Returns only the estimator name without metadata

train_test_evaluate(X_train, X_test, y_train, y_test, tune_models=None, metrics='default', multi_output=False, multi_task=False, target_scaling_strategy=None, save_pipeline_to_disk=True, experiment_name=None, run_name=None)[source]

Trains the data on the given dataset, evaluate the models and returns comparison metrics

X_trainpandas dataframe

Training data

X_testpandas dataframe

Test data

y_trainarray of shape (X_train.shape[0],)

Target values of training dataset

y_testarray of shape (X_test.shape[0],)

Target values of test dataset

tune_models{‘all’, None} or list of models to be trained, default=None

all: tune all regression models list: list of models to be trained None: hyperparameter tuning will not be performed

metrics{‘all’, ‘default’}, default=’default’
  • all:

    mean_absolute_error, mean_squared_error, r2_score, explained_variance_score, max_error, mean_squared_log_error, median_absolute_error, mean_absolute_percentage_error, mean_poisson_deviance, mean_gamma_deviance, mean_tweedie_deviance, d2_tweedie_score, mean_pinball_loss

  • default:

    mean_absolute_error, mean_squared_error, r2_score

multi_outputbool, default=False

Future use

multi_taskbool, default=False

Future use

target_scaling_strategy{‘StandardScaler’, ‘MinMaxScaler’, ‘MaxAbsScaler’, ‘RobustScaler’, None}, default=None

Scales the target variable before training the model

save_pipeline_to_diskbool, default=True

Save preprocessor and model training pipeline to the disk. Should be set to True if needs model to be deployed as an API

experiment_namestr, default=None

Name of the experiment

run_namestr,default=None

Name of the run within the experiment

Examples

Regression

regression_hyperparameter_tuning

GPU Acceleration

  • If your system is equipped with an NVIDIA GPU and you want to utilize GPU acceleration for model training, you can install the RAPIDS cuML package by executing the following command:

pip install cudf-cu11 cuml-cu11 --extra-index-url=https://pypi.nvidia.com


  • The cuml package provides GPU-accelerated implementations of various machine learning algorithms. By installing this package, you can leverage the power of your GPU to significantly improve the speed and performance of your machine learning workflows.

  • For the list of supported algorithms, please refer https://docs.rapids.ai/api/cuml/stable/api/#regression-and-classification

  • Acceleration extensions can ben enabled by passing the parameter enable_acceleration_extensions=True during the initialize phase.

regression_gpu_acceleration_nvidia.html

CPU Acceleration

  • If your system is equipped with an Intel CPU and you want to utilize CPU acceleration for model training, you can install the Intel® Extension for Scikit-learn package by executing the following command:

pip install -U scikit-learn-intelex


  • The scikit-learn-intelex package provides CPU-accelerated implementations of Scikit-learn algorithms. By installing this package, you can leverage the power of your Intel CPU to significantly improve the speed and performance of your machine learning workflows.

  • For the list of supported algorithms, please refer to the [Intel® Extension for Scikit-learn documentation](https://intel.github.io/scikit-learn-intelex/algorithms.html#on-cpu).

  • Acceleration extensions can ben enabled by passing the parameter enable_acceleration_extensions=True during the initialize phase.

regression_cpu_acceleration_intel