Skip to content

TBoostRegressor

class TBoostRegressor(n_trees=4000,
                      learning_rate=0.05,
                      lambda_=1.0,
                      *,
                      lambda_scale_invariant=False,
                      l1_leaf=0.0,
                      min_split_gain=0.0,
                      max_delta_step=None,
                      max_delta_step_gated=None,
                      max_bin=254,
                      objective="squared_error",
                      tweedie_rho=1.5,
                      min_data_in_leaf=None,
                      min_sum_hessian_in_leaf=0.0,
                      min_weight_sum_in_leaf=0.0,
                      path_smooth=None,
                      subsample=None,
                      colsample_bytree=0.8,
                      learning_rate_decay=0.0,
                      validation_fraction=0.1,
                      early_stopping_rounds=500,
                      early_stopping_adaptive=1.5,
                      early_stopping_min_delta=0.0001,
                      interaction_gain_hurdle=2.0,
                      interaction_gain_hurdle_mode="adaptive",
                      graduate=None,
                      graduation_alpha=None,
                      graduation_high_order_alpha=0.0,
                      leaf_refine_steps=4,
                      leaf_refine_backtracks=4,
                      refine_closed_form_tier2=True,
                      incremental_mu=False,
                      mvs_min_rows=1,
                      hist_precision=None,
                      n_bags=8,
                      bag_subsample=0.8,
                      cell_refit_base=None,
                      cell_refit_gamma=2.0,
                      ridge_refit_l2=None,
                      ridge_refit_max_iter=5,
                      nesterov=False,
                      dart_drop_rate=None,
                      random_strength=0.0,
                      reanchor=None,
                      reanchor_slope=None,
                      max_interaction_order=3,
                      max_depth=3,
                      table_budget_cells=None,
                      table_budget_order_shrink=2.0,
                      seed=0,
                      n_jobs=None,
                      monotone_constraints=None,
                      categorical_features=None,
                      cat_smooth=None,
                      cat_target=None,
                      cat_leakage=None,
                      cat_n_perms=1,
                      cat_k=5,
                      cat_min_data_per_group=10.0,
                      cat_direct_max_levels=16,
                      cat_channels=None,
                      cat_count_min_levels=20,
                      cat_class_freq_min_levels=3,
                      prune=True,
                      prune_validation_fraction=0.15,
                      prune_se_rule=0.0,
                      prune_n_folds=5,
                      prune_refit_full=False,
                      prune_rebalance=True,
                      ref_measure=None,
                      measure_floor=0.001,
                      prune_guard=True,
                      prune_guard_tol=0.05,
                      prune_drop_z=2.0,
                      prune_keep_budget=32,
                      prune_fold_fidelity=False,
                      prune_guard_z=0.0,
                      prune_guard_z_dn=2.0,
                      prune_guard_tol_floor=0.005,
                      multiclass_prune_guard=True,
                      multiclass_prune_sel_bags=1,
                      multiclass_prune_cv=True,
                      multiclass_prune_guard_floor=0.002,
                      prune_box_budget=0,
                      prune_lambda_boxes=0.0,
                      prune_table_budget=0,
                      prune_lambda_tables=0.0,
                      prune_table_min_arity=3,
                      prune_min_stability=0.5,
                      prune_min_mean_gain=0.0,
                      prune_selector="ranked_path",
                      prune_path_steps=32,
                      prune_path_fraction=0.995,
                      prune_path_tolerance=0.001,
                      prune_main_effects=False,
                      band_tolerance=0.75,
                      band_deviance_cap=0.001,
                      prune_fold_min_rows=125,
                      prune_fold_es_patience=None,
                      prune_guard_min_rows=500,
                      prune_slope_eps=0.01,
                      prune_slope_min_z=3.0,
                      prune_size_penalty=None,
                      early_stopping=None,
                      unknown_category="rare")

Purpose

Implementation of the scikit-learn estimator API for t-boost regression. scikit-learn itself is optional: without it, the class runs standalone with the same methods.

Supports model training, inference and auxiliary calculations like rating tables, prediction contributions and feature importance.

The supported objectives are squared_error, poisson, gamma and tweedie (see Regression: objectives and metrics).

Parameters

See Training parameters for the full list of parameters. n_trees, learning_rate and lambda_ can be passed by position; every other parameter is keyword-only.

Attributes

feature_importances_

Return the importance of each input feature, in the order of the input columns.

required_columns

The input columns needed to apply the model.

n_features_in_, feature_names_in_

The number and the names of the features seen during fit.

categories_

The levels of each categorical feature seen during fit.

The link between the raw score and the prediction.

n_trees_, n_trees_per_bag_

The number of trees in the model, overall and per bag.

stopping_reason_, stopping_reason_per_bag_

Why the training stopped, overall and per bag.

evals_result_

Return the values of metrics calculated during the training.

pruning_report_, graduation_report_

The records of the table selection and of graduation.

binding_report_

Which of the parameters set away from their defaults took effect on the fit.

delta_step_gate_

What the guard of max_delta_step_gated saw.

metadata

Your own JSON metadata, saved with the model.

Methods

fit

Train a model.

predict

Apply the model to the given dataset.

predict_raw

Apply the model to the given dataset and return the raw score on the link scale.

predict_contributions

Calculate the contribution of each rating table to the prediction for every object.

tables

Export the exact rating tables of the model as a JSON document.

cell_indices

Return the rating-table cell every object falls in.

actual_vs_expected

Calculate actual versus expected totals by rating-factor level, for every feature.

pricing_report

Return the rating tables, the actual versus expected cells and the stage diagnostics for review.

unseen_values

Count the categorical values in the dataset that are absent from the training data.

score

Calculate the R2 metric for the objects in the given dataset.

check_bindings

Raise an error if a parameter set away from its default had no effect on the fit.

get_params

Return the values of all training parameters.

set_params

Set the training parameters.

to_bytes

Serialize the trained model to a compact binary format.

to_json

Serialize the trained model to a JSON document.

from_bytes

Load a model from the binary format written by to_bytes.

from_json

Load a model from the JSON document written by to_json.