XGBoost Python 包
本页包含所有与Python相关的文档链接。要安装该包,请查看 安装指南。
内容
- Python 包介绍
- 使用 Scikit-Learn 估计器接口
- Python API 参考
- 全局配置
- 核心数据结构
DMatrix
DMatrix.data_split_mode()
DMatrix.feature_names
DMatrix.feature_types
DMatrix.get_base_margin()
DMatrix.get_data()
DMatrix.get_float_info()
DMatrix.get_group()
DMatrix.get_label()
DMatrix.get_quantile_cut()
DMatrix.get_uint_info()
DMatrix.get_weight()
DMatrix.num_col()
DMatrix.num_nonmissing()
DMatrix.num_row()
DMatrix.save_binary()
DMatrix.set_base_margin()
DMatrix.set_float_info()
DMatrix.set_float_info_npy2d()
DMatrix.set_group()
DMatrix.set_info()
DMatrix.set_label()
DMatrix.set_uint_info()
DMatrix.set_weight()
DMatrix.slice()
QuantileDMatrix
Booster
Booster.attr()
Booster.attributes()
Booster.best_iteration
Booster.best_score
Booster.boost()
Booster.copy()
Booster.dump_model()
Booster.eval()
Booster.eval_set()
Booster.feature_names
Booster.feature_types
Booster.get_dump()
Booster.get_fscore()
Booster.get_score()
Booster.get_split_value_histogram()
Booster.inplace_predict()
Booster.load_config()
Booster.load_model()
Booster.num_boosted_rounds()
Booster.num_features()
Booster.predict()
Booster.save_config()
Booster.save_model()
Booster.save_raw()
Booster.set_attr()
Booster.set_param()
Booster.trees_to_dataframe()
Booster.update()
DataIter
- 学习 API
- Scikit-Learn API
XGBRegressor
XGBRegressor.apply()
XGBRegressor.best_iteration
XGBRegressor.best_score
XGBRegressor.coef_
XGBRegressor.evals_result()
XGBRegressor.feature_importances_
XGBRegressor.feature_names_in_
XGBRegressor.fit()
XGBRegressor.get_booster()
XGBRegressor.get_metadata_routing()
XGBRegressor.get_num_boosting_rounds()
XGBRegressor.get_params()
XGBRegressor.get_xgb_params()
XGBRegressor.intercept_
XGBRegressor.load_model()
XGBRegressor.n_features_in_
XGBRegressor.predict()
XGBRegressor.save_model()
XGBRegressor.score()
XGBRegressor.set_fit_request()
XGBRegressor.set_params()
XGBRegressor.set_predict_request()
XGBRegressor.set_score_request()
XGBClassifier
XGBClassifier.apply()
XGBClassifier.best_iteration
XGBClassifier.best_score
XGBClassifier.coef_
XGBClassifier.evals_result()
XGBClassifier.feature_importances_
XGBClassifier.feature_names_in_
XGBClassifier.fit()
XGBClassifier.get_booster()
XGBClassifier.get_metadata_routing()
XGBClassifier.get_num_boosting_rounds()
XGBClassifier.get_params()
XGBClassifier.get_xgb_params()
XGBClassifier.intercept_
XGBClassifier.load_model()
XGBClassifier.n_features_in_
XGBClassifier.predict()
XGBClassifier.predict_proba()
XGBClassifier.save_model()
XGBClassifier.score()
XGBClassifier.set_fit_request()
XGBClassifier.set_params()
XGBClassifier.set_predict_proba_request()
XGBClassifier.set_predict_request()
XGBClassifier.set_score_request()
XGBRanker
XGBRanker.apply()
XGBRanker.best_iteration
XGBRanker.best_score
XGBRanker.coef_
XGBRanker.evals_result()
XGBRanker.feature_importances_
XGBRanker.feature_names_in_
XGBRanker.fit()
XGBRanker.get_booster()
XGBRanker.get_metadata_routing()
XGBRanker.get_num_boosting_rounds()
XGBRanker.get_params()
XGBRanker.get_xgb_params()
XGBRanker.intercept_
XGBRanker.load_model()
XGBRanker.n_features_in_
XGBRanker.predict()
XGBRanker.save_model()
XGBRanker.score()
XGBRanker.set_fit_request()
XGBRanker.set_params()
XGBRanker.set_predict_request()
XGBRFRegressor
XGBRFRegressor.apply()
XGBRFRegressor.best_iteration
XGBRFRegressor.best_score
XGBRFRegressor.coef_
XGBRFRegressor.evals_result()
XGBRFRegressor.feature_importances_
XGBRFRegressor.feature_names_in_
XGBRFRegressor.fit()
XGBRFRegressor.get_booster()
XGBRFRegressor.get_metadata_routing()
XGBRFRegressor.get_num_boosting_rounds()
XGBRFRegressor.get_params()
XGBRFRegressor.get_xgb_params()
XGBRFRegressor.intercept_
XGBRFRegressor.load_model()
XGBRFRegressor.n_features_in_
XGBRFRegressor.predict()
XGBRFRegressor.save_model()
XGBRFRegressor.score()
XGBRFRegressor.set_fit_request()
XGBRFRegressor.set_params()
XGBRFRegressor.set_predict_request()
XGBRFRegressor.set_score_request()
XGBRFClassifier
XGBRFClassifier.apply()
XGBRFClassifier.best_iteration
XGBRFClassifier.best_score
XGBRFClassifier.coef_
XGBRFClassifier.evals_result()
XGBRFClassifier.feature_importances_
XGBRFClassifier.feature_names_in_
XGBRFClassifier.fit()
XGBRFClassifier.get_booster()
XGBRFClassifier.get_metadata_routing()
XGBRFClassifier.get_num_boosting_rounds()
XGBRFClassifier.get_params()
XGBRFClassifier.get_xgb_params()
XGBRFClassifier.intercept_
XGBRFClassifier.load_model()
XGBRFClassifier.n_features_in_
XGBRFClassifier.predict()
XGBRFClassifier.predict_proba()
XGBRFClassifier.save_model()
XGBRFClassifier.score()
XGBRFClassifier.set_fit_request()
XGBRFClassifier.set_params()
XGBRFClassifier.set_predict_proba_request()
XGBRFClassifier.set_predict_request()
XGBRFClassifier.set_score_request()
- 绘图 API
- 回调 API
- Dask API
- 分布式训练的 Dask 扩展
DaskDMatrix
DaskQuantileDMatrix
train()
predict()
inplace_predict()
DaskXGBClassifier
DaskXGBClassifier.apply()
DaskXGBClassifier.best_iteration
DaskXGBClassifier.best_score
DaskXGBClassifier.client
DaskXGBClassifier.coef_
DaskXGBClassifier.evals_result()
DaskXGBClassifier.feature_importances_
DaskXGBClassifier.feature_names_in_
DaskXGBClassifier.fit()
DaskXGBClassifier.get_booster()
DaskXGBClassifier.get_metadata_routing()
DaskXGBClassifier.get_num_boosting_rounds()
DaskXGBClassifier.get_params()
DaskXGBClassifier.get_xgb_params()
DaskXGBClassifier.intercept_
DaskXGBClassifier.load_model()
DaskXGBClassifier.n_features_in_
DaskXGBClassifier.predict()
DaskXGBClassifier.predict_proba()
DaskXGBClassifier.save_model()
DaskXGBClassifier.score()
DaskXGBClassifier.set_fit_request()
DaskXGBClassifier.set_params()
DaskXGBClassifier.set_predict_proba_request()
DaskXGBClassifier.set_predict_request()
DaskXGBClassifier.set_score_request()
DaskXGBRegressor
DaskXGBRegressor.apply()
DaskXGBRegressor.best_iteration
DaskXGBRegressor.best_score
DaskXGBRegressor.client
DaskXGBRegressor.coef_
DaskXGBRegressor.evals_result()
DaskXGBRegressor.feature_importances_
DaskXGBRegressor.feature_names_in_
DaskXGBRegressor.fit()
DaskXGBRegressor.get_booster()
DaskXGBRegressor.get_metadata_routing()
DaskXGBRegressor.get_num_boosting_rounds()
DaskXGBRegressor.get_params()
DaskXGBRegressor.get_xgb_params()
DaskXGBRegressor.intercept_
DaskXGBRegressor.load_model()
DaskXGBRegressor.n_features_in_
DaskXGBRegressor.predict()
DaskXGBRegressor.save_model()
DaskXGBRegressor.score()
DaskXGBRegressor.set_fit_request()
DaskXGBRegressor.set_params()
DaskXGBRegressor.set_predict_request()
DaskXGBRegressor.set_score_request()
DaskXGBRanker
DaskXGBRanker.apply()
DaskXGBRanker.best_iteration
DaskXGBRanker.best_score
DaskXGBRanker.client
DaskXGBRanker.coef_
DaskXGBRanker.evals_result()
DaskXGBRanker.feature_importances_
DaskXGBRanker.feature_names_in_
DaskXGBRanker.fit()
DaskXGBRanker.get_booster()
DaskXGBRanker.get_metadata_routing()
DaskXGBRanker.get_num_boosting_rounds()
DaskXGBRanker.get_params()
DaskXGBRanker.get_xgb_params()
DaskXGBRanker.intercept_
DaskXGBRanker.load_model()
DaskXGBRanker.n_features_in_
DaskXGBRanker.predict()
DaskXGBRanker.save_model()
DaskXGBRanker.set_fit_request()
DaskXGBRanker.set_params()
DaskXGBRanker.set_predict_request()
DaskXGBRFRegressor
DaskXGBRFRegressor.apply()
DaskXGBRFRegressor.best_iteration
DaskXGBRFRegressor.best_score
DaskXGBRFRegressor.client
DaskXGBRFRegressor.coef_
DaskXGBRFRegressor.evals_result()
DaskXGBRFRegressor.feature_importances_
DaskXGBRFRegressor.feature_names_in_
DaskXGBRFRegressor.fit()
DaskXGBRFRegressor.get_booster()
DaskXGBRFRegressor.get_metadata_routing()
DaskXGBRFRegressor.get_num_boosting_rounds()
DaskXGBRFRegressor.get_params()
DaskXGBRFRegressor.get_xgb_params()
DaskXGBRFRegressor.intercept_
DaskXGBRFRegressor.load_model()
DaskXGBRFRegressor.n_features_in_
DaskXGBRFRegressor.predict()
DaskXGBRFRegressor.save_model()
DaskXGBRFRegressor.score()
DaskXGBRFRegressor.set_fit_request()
DaskXGBRFRegressor.set_params()
DaskXGBRFRegressor.set_predict_request()
DaskXGBRFRegressor.set_score_request()
DaskXGBRFClassifier
DaskXGBRFClassifier.apply()
DaskXGBRFClassifier.best_iteration
DaskXGBRFClassifier.best_score
DaskXGBRFClassifier.client
DaskXGBRFClassifier.coef_
DaskXGBRFClassifier.evals_result()
DaskXGBRFClassifier.feature_importances_
DaskXGBRFClassifier.feature_names_in_
DaskXGBRFClassifier.fit()
DaskXGBRFClassifier.get_booster()
DaskXGBRFClassifier.get_metadata_routing()
DaskXGBRFClassifier.get_num_boosting_rounds()
DaskXGBRFClassifier.get_params()
DaskXGBRFClassifier.get_xgb_params()
DaskXGBRFClassifier.intercept_
DaskXGBRFClassifier.load_model()
DaskXGBRFClassifier.n_features_in_
DaskXGBRFClassifier.predict()
DaskXGBRFClassifier.predict_proba()
DaskXGBRFClassifier.save_model()
DaskXGBRFClassifier.score()
DaskXGBRFClassifier.set_fit_request()
DaskXGBRFClassifier.set_params()
DaskXGBRFClassifier.set_predict_proba_request()
DaskXGBRFClassifier.set_predict_request()
DaskXGBRFClassifier.set_score_request()
- PySpark API
SparkXGBClassifier
SparkXGBClassifier.clear()
SparkXGBClassifier.copy()
SparkXGBClassifier.explainParam()
SparkXGBClassifier.explainParams()
SparkXGBClassifier.extractParamMap()
SparkXGBClassifier.fit()
SparkXGBClassifier.fitMultiple()
SparkXGBClassifier.getFeaturesCol()
SparkXGBClassifier.getLabelCol()
SparkXGBClassifier.getOrDefault()
SparkXGBClassifier.getParam()
SparkXGBClassifier.getPredictionCol()
SparkXGBClassifier.getProbabilityCol()
SparkXGBClassifier.getRawPredictionCol()
SparkXGBClassifier.getValidationIndicatorCol()
SparkXGBClassifier.getWeightCol()
SparkXGBClassifier.hasDefault()
SparkXGBClassifier.hasParam()
SparkXGBClassifier.isDefined()
SparkXGBClassifier.isSet()
SparkXGBClassifier.load()
SparkXGBClassifier.params
SparkXGBClassifier.read()
SparkXGBClassifier.save()
SparkXGBClassifier.set()
SparkXGBClassifier.setParams()
SparkXGBClassifier.set_device()
SparkXGBClassifier.uid
SparkXGBClassifier.write()
SparkXGBClassifierModel
SparkXGBClassifierModel.clear()
SparkXGBClassifierModel.copy()
SparkXGBClassifierModel.explainParam()
SparkXGBClassifierModel.explainParams()
SparkXGBClassifierModel.extractParamMap()
SparkXGBClassifierModel.getFeaturesCol()
SparkXGBClassifierModel.getLabelCol()
SparkXGBClassifierModel.getOrDefault()
SparkXGBClassifierModel.getParam()
SparkXGBClassifierModel.getPredictionCol()
SparkXGBClassifierModel.getProbabilityCol()
SparkXGBClassifierModel.getRawPredictionCol()
SparkXGBClassifierModel.getValidationIndicatorCol()
SparkXGBClassifierModel.getWeightCol()
SparkXGBClassifierModel.get_booster()
SparkXGBClassifierModel.get_feature_importances()
SparkXGBClassifierModel.hasDefault()
SparkXGBClassifierModel.hasParam()
SparkXGBClassifierModel.isDefined()
SparkXGBClassifierModel.isSet()
SparkXGBClassifierModel.load()
SparkXGBClassifierModel.params
SparkXGBClassifierModel.read()
SparkXGBClassifierModel.save()
SparkXGBClassifierModel.set()
SparkXGBClassifierModel.set_device()
SparkXGBClassifierModel.transform()
SparkXGBClassifierModel.uid
SparkXGBClassifierModel.write()
SparkXGBRegressor
SparkXGBRegressor.clear()
SparkXGBRegressor.copy()
SparkXGBRegressor.explainParam()
SparkXGBRegressor.explainParams()
SparkXGBRegressor.extractParamMap()
SparkXGBRegressor.fit()
SparkXGBRegressor.fitMultiple()
SparkXGBRegressor.getFeaturesCol()
SparkXGBRegressor.getLabelCol()
SparkXGBRegressor.getOrDefault()
SparkXGBRegressor.getParam()
SparkXGBRegressor.getPredictionCol()
SparkXGBRegressor.getValidationIndicatorCol()
SparkXGBRegressor.getWeightCol()
SparkXGBRegressor.hasDefault()
SparkXGBRegressor.hasParam()
SparkXGBRegressor.isDefined()
SparkXGBRegressor.isSet()
SparkXGBRegressor.load()
SparkXGBRegressor.params
SparkXGBRegressor.read()
SparkXGBRegressor.save()
SparkXGBRegressor.set()
SparkXGBRegressor.setParams()
SparkXGBRegressor.set_device()
SparkXGBRegressor.uid
SparkXGBRegressor.write()
SparkXGBRegressorModel
SparkXGBRegressorModel.clear()
SparkXGBRegressorModel.copy()
SparkXGBRegressorModel.explainParam()
SparkXGBRegressorModel.explainParams()
SparkXGBRegressorModel.extractParamMap()
SparkXGBRegressorModel.getFeaturesCol()
SparkXGBRegressorModel.getLabelCol()
SparkXGBRegressorModel.getOrDefault()
SparkXGBRegressorModel.getParam()
SparkXGBRegressorModel.getPredictionCol()
SparkXGBRegressorModel.getValidationIndicatorCol()
SparkXGBRegressorModel.getWeightCol()
SparkXGBRegressorModel.get_booster()
SparkXGBRegressorModel.get_feature_importances()
SparkXGBRegressorModel.hasDefault()
SparkXGBRegressorModel.hasParam()
SparkXGBRegressorModel.isDefined()
SparkXGBRegressorModel.isSet()
SparkXGBRegressorModel.load()
SparkXGBRegressorModel.params
SparkXGBRegressorModel.read()
SparkXGBRegressorModel.save()
SparkXGBRegressorModel.set()
SparkXGBRegressorModel.set_device()
SparkXGBRegressorModel.transform()
SparkXGBRegressorModel.uid
SparkXGBRegressorModel.write()
SparkXGBRanker
SparkXGBRanker.clear()
SparkXGBRanker.copy()
SparkXGBRanker.explainParam()
SparkXGBRanker.explainParams()
SparkXGBRanker.extractParamMap()
SparkXGBRanker.fit()
SparkXGBRanker.fitMultiple()
SparkXGBRanker.getFeaturesCol()
SparkXGBRanker.getLabelCol()
SparkXGBRanker.getOrDefault()
SparkXGBRanker.getParam()
SparkXGBRanker.getPredictionCol()
SparkXGBRanker.getValidationIndicatorCol()
SparkXGBRanker.getWeightCol()
SparkXGBRanker.hasDefault()
SparkXGBRanker.hasParam()
SparkXGBRanker.isDefined()
SparkXGBRanker.isSet()
SparkXGBRanker.load()
SparkXGBRanker.params
SparkXGBRanker.read()
SparkXGBRanker.save()
SparkXGBRanker.set()
SparkXGBRanker.setParams()
SparkXGBRanker.set_device()
SparkXGBRanker.uid
SparkXGBRanker.write()
SparkXGBRankerModel
SparkXGBRankerModel.clear()
SparkXGBRankerModel.copy()
SparkXGBRankerModel.explainParam()
SparkXGBRankerModel.explainParams()
SparkXGBRankerModel.extractParamMap()
SparkXGBRankerModel.getFeaturesCol()
SparkXGBRankerModel.getLabelCol()
SparkXGBRankerModel.getOrDefault()
SparkXGBRankerModel.getParam()
SparkXGBRankerModel.getPredictionCol()
SparkXGBRankerModel.getValidationIndicatorCol()
SparkXGBRankerModel.getWeightCol()
SparkXGBRankerModel.get_booster()
SparkXGBRankerModel.get_feature_importances()
SparkXGBRankerModel.hasDefault()
SparkXGBRankerModel.hasParam()
SparkXGBRankerModel.isDefined()
SparkXGBRankerModel.isSet()
SparkXGBRankerModel.load()
SparkXGBRankerModel.params
SparkXGBRankerModel.read()
SparkXGBRankerModel.save()
SparkXGBRankerModel.set()
SparkXGBRankerModel.set_device()
SparkXGBRankerModel.transform()
SparkXGBRankerModel.uid
SparkXGBRankerModel.write()
- 回调函数
- 模型
- XGBoost Python 功能演练
- XGBoost Dask 功能演示
- 生存分析演练
- GPU 加速演示
- 使用带有 RAPIDS 内存管理器 (RMM) 插件的 XGBoost(实验性)