guide.GuideBoostingRegressor¶
- class guide.GuideBoostingRegressor(*, loss='squared_error', n_estimators=100, learning_rate=0.1, max_depth=3, min_samples_leaf=2, min_child_weight=1.0, reg_lambda=1.0, gamma=0.0, subsample=1.0, max_features=None, early_stopping_rounds=None, interactions=True, significance_level=0.1, max_split_candidates=100, categorical_features=None, feature_roles=None, periodic_features=None, missing_flags=None, n_jobs=None, random_state=0)¶
Gradient-boosted GUIDE regression trees (experimental).
Boosting is a guide-rs extension, not part of GUIDE; its variable selection and defaults may change between releases.
Each split variable is chosen by chi-square tests of the gradients against each predictor’s bins: GUIDE’s tests on their signs for squared error, and score tests for bin effects for the Poisson and logistic losses. Boosted trees thus inherit GUIDE’s unbiased variable selection; the split point maximizes the second-order (Newton) gain.
- Parameters:
- loss{“squared_error”, “poisson”, “logistic”}, default=”squared_error”
Poisson uses a log link and accepts
exposure; logistic fits a 0/1 response and predicts probabilities.- n_estimatorsint, default=100
Maximum number of boosting rounds. Multiclass models fit one tree per class in each round.
- learning_ratefloat, default=0.1
Shrinkage applied to every leaf value.
- max_depthint, default=3
Depth of each tree; boosted trees are not pruned.
- min_samples_leafint, default=2
- min_child_weightfloat, default=1.0
Minimum sum of loss Hessians (times sample weights) in a child.
- reg_lambdafloat, default=1.0
L2 penalty on leaf values.
- gammafloat, default=0.0
Minimum gain to split.
- subsamplefloat, default=1.0
Fraction of rows sampled without replacement for each round.
- max_featuresint or float, default=None
Split variables sampled at each node; by default all.
- early_stopping_roundsint, default=None
Stop when the loss on
validation_data(passed tofit) has not improved for this many rounds, and keep the best round.- interactions, significance_level, max_split_candidates, categorical_features, feature_roles, periodic_features, missing_flags, n_jobs, random_state
As in
GuideRegressor. After the first round the chi-square statistics rank variables; they are not significance tests.
- __init__(*, loss='squared_error', n_estimators=100, learning_rate=0.1, max_depth=3, min_samples_leaf=2, min_child_weight=1.0, reg_lambda=1.0, gamma=0.0, subsample=1.0, max_features=None, early_stopping_rounds=None, interactions=True, significance_level=0.1, max_split_candidates=100, categorical_features=None, feature_roles=None, periodic_features=None, missing_flags=None, n_jobs=None, random_state=0)¶
Methods
__init__(*[, loss, n_estimators, ...])apply(X)Terminal node ids, shape (n_samples, n_trees).
fit(X, y[, sample_weight, exposure, ...])Fit the model.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
predict(X[, exposure])Predicted response; Poisson models fitted with exposure need it here too.
score(X, y[, sample_weight])Return coefficient of determination on test data.
set_fit_request(*[, exposure, ...])Configure whether metadata should be requested to be passed to the
fitmethod.set_params(**params)Set the parameters of this estimator.
set_predict_request(*[, exposure])Configure whether metadata should be requested to be passed to the
predictmethod.set_score_request(*[, sample_weight])Configure whether metadata should be requested to be passed to the
scoremethod.to_dot()The fitted model in Graphviz DOT format.
to_json()The fitted model in the format saved by the guide-rs CLI.
to_text()The fitted model as indented text.
Attributes
n_estimators_Boosting rounds kept; with early stopping, the best validation round.