Scikit-Learn API#

XGBRegressor#

Constructor#

XGBRegressor(*args, **kwargs)

Implementation of the scikit-learn API for XGBoost regression.

Attributes#

XGBRegressor.apply(X[, iteration_range])

Return the predicted leaf every tree for each sample.

XGBRegressor.evals_result()

Return the evaluation results.

XGBRegressor.fit(X, y[, sample_weight, ...])

Fit gradient boosting model.

XGBRegressor.get_booster()

Get the underlying xgboost Booster of this model.

XGBRegressor.get_num_boosting_rounds()

Gets the number of xgboost boosting rounds.

XGBRegressor.get_params([deep])

Get parameters.

XGBRegressor.get_xgb_params()

Get xgboost specific parameters.

XGBRegressor.load_model(fname)

Load the model from a file or bytearray.

XGBRegressor.predict(data, **kw)

Predict with X.

XGBRegressor.save_model(fname)

Save the model to a file.

XGBRegressor.set_params(**params)

Set the parameters of this estimator.

XGBClassifier#

Constructor#

XGBClassifier(*args, **kwargs)

Implementation of the scikit-learn API for XGBoost classification.

Attributes#

XGBClassifier.apply(X[, iteration_range])

Return the predicted leaf every tree for each sample.

XGBClassifier.evals_result()

Return the evaluation results.

XGBClassifier.fit(X, y[, sample_weight, ...])

Fit gradient boosting classifier.

XGBClassifier.get_booster()

Get the underlying xgboost Booster of this model.

XGBClassifier.get_num_boosting_rounds()

Gets the number of xgboost boosting rounds.

XGBClassifier.get_params([deep])

Get parameters.

XGBClassifier.get_xgb_params()

Get xgboost specific parameters.

XGBClassifier.load_model(fname)

Load the model from a file or bytearray.

XGBClassifier.predict(data, **kw)

XGBClassifier.predict_proba(data[, ntree_limit])

Predict the probability of each X example being of a given class.

XGBClassifier.save_model(fname)

Save the model to a file.

XGBClassifier.score(X, y[, sample_weight])

Return the mean accuracy on the given test data and labels.

XGBClassifier.set_params(**params)

Set the parameters of this estimator.