XGBoostClassifier 类

XGBoost 分类器类。

继承
sklearn.base.BaseEstimator
XGBoostClassifier
sklearn.base.ClassifierMixin
XGBoostClassifier
azureml.automl.runtime.shared.model_wrappers._AbstractModelWrapper
XGBoostClassifier

构造函数

XGBoostClassifier(random_state=0, n_jobs=1, problem_info=None, **kwargs)

参数

random_state
int 或 <xref:np.random.RandomState>
默认值: 0

RandomState 实例或 None,可选 (default=None) 如果为 int,则 random_state 是随机数生成器使用的种子;如果为 RandomState 实例,则 random_state 是随机数生成器;如果为 None,则随机数生成器是 np.random 使用的 RandomState 实例。

n_jobs
int
默认值: 1

并行线程数。

kwargs
默认值: None

如需其他参数,请查看 https://xgboost.readthedocs.io/en/latest/parameter.html 以获取更多参数。

方法

fit

XGBoost 分类器模型的拟合函数。

get_model

返回 XGBoost 分类器模型。

否则返回 None。

get_params

返回 XGBoost 分类器模型的参数。

predict

XGBoost 分类器模型的预测函数。

predict_proba

XGBoost 分类器模型的 X 的预测类概率。

fit

XGBoost 分类器模型的拟合函数。

fit(X, y, **kwargs)

参数

X
ndarray
必需

输入数据。

y
ndarray
必需

输入目标值。

kwargs
必需

如需其他参数,请查看 https://xgboost.readthedocs.io/en/latest/parameter.html 以获取更多参数。

返回

拟合模型后执行 Self 操作。

get_model

返回 XGBoost 分类器模型。

否则返回 None。

get_model()

返回

如果已调用拟合方法,则返回拟合模型。

get_params

返回 XGBoost 分类器模型的参数。

get_params(deep=True)

参数

deep
bool
默认值: True

如果为 True,则返回此估算器的参数和包含的子对象(即估算器)。

返回

XGBoost 分类器模型的参数。

predict

XGBoost 分类器模型的预测函数。

predict(X)

参数

X
ndarray
必需

输入数据。

返回

XGBoost 分类器模型的预测值。

predict_proba

XGBoost 分类器模型的 X 的预测类概率。

predict_proba(X)

参数

X
ndarray
必需

输入数据。

返回

XGBoost 分类器模型的预测概率值。