mars.learn.contrib.xgboost.XGBRegressor

class mars.learn.contrib.xgboost.XGBRegressor(max_depth=None, learning_rate=None, n_estimators=100, verbosity=None, objective=None, booster=None, tree_method=None, n_jobs=None, gamma=None, min_child_weight=None, max_delta_step=None, subsample=None, colsample_bytree=None, colsample_bylevel=None, colsample_bynode=None, reg_alpha=None, reg_lambda=None, scale_pos_weight=None, base_score=None, random_state=None, missing=nan, num_parallel_tree=None, monotone_constraints=None, interaction_constraints=None, importance_type='gain', gpu_id=None, validate_parameters=None, **kwargs)[源代码]

Implementation of the scikit-learn API for XGBoost regressor.

__init__(max_depth=None, learning_rate=None, n_estimators=100, verbosity=None, objective=None, booster=None, tree_method=None, n_jobs=None, gamma=None, min_child_weight=None, max_delta_step=None, subsample=None, colsample_bytree=None, colsample_bylevel=None, colsample_bynode=None, reg_alpha=None, reg_lambda=None, scale_pos_weight=None, base_score=None, random_state=None, missing=nan, num_parallel_tree=None, monotone_constraints=None, interaction_constraints=None, importance_type='gain', gpu_id=None, validate_parameters=None, **kwargs)[源代码]

Methods

__init__([max_depth, learning_rate, …])

apply(X[, ntree_limit, iteration_range])

Return the predicted leaf every tree for each sample.

evals_result()

Return the evaluation results.

fit(X, y[, sample_weights, eval_set, …])

Fit the regressor. :param X: Feature matrix :type X: array_like :param y: Labels :type y: array_like :param sample_weight: instance weights :type sample_weight: array_like :param eval_set: A list of (X, y) tuple pairs to use as validation sets, for which metrics will be computed. Validation metrics will help us track the performance of the model. :type eval_set: list, optional :param sample_weight_eval_set: A list of the form [L_1, L_2, …, L_n], where each L_i is a list of group weights on the i-th validation set. :type sample_weight_eval_set: list, optional.

get_booster()

Get the underlying xgboost Booster of this model.

get_num_boosting_rounds()

Gets the number of xgboost boosting rounds.

get_params([deep])

Get parameters.

get_xgb_params()

Get xgboost specific parameters.

load_model(fname)

Load the model from a file.

predict(data, **kw)

Predict with data.

save_model(fname)

Save the model to a file.

set_params(**params)

Set the parameters of this estimator.

Attributes

best_iteration

best_ntree_limit

best_score

coef_

Coefficients property

feature_importances_

Feature importances property

intercept_

Intercept (bias) property

n_features_in_