LightGBMClassifier 类

LightGBM 分类器类。

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

构造函数

LightGBMClassifier(random_state=None, n_jobs=1, problem_info=None, **kwargs)

参数

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

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

n_jobs
int
默认值: 1

并行线程数。

kwargs
默认值: None

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

方法

fit

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

get_model

返回 LightGBM 分类器模型。

否则返回 None。

get_params

返回 LightGBM 回归量模型的参数。

predict

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

predict_proba

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

fit

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

fit(X: numpy.ndarray, y: numpy.ndarray, **kwargs: Any) -> azureml.automl.runtime.shared.model_wrappers.LightGBMClassifier

参数

X
必需

输入数据。

y
必需

输入目标值。

kwargs
必需

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

返回

拟合模型后的 Self。

get_model

返回 LightGBM 分类器模型。

否则返回 None。

get_model()

返回

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

get_params

返回 LightGBM 回归量模型的参数。

get_params(deep: bool = True) -> Dict[str, Any]

参数

deep
bool
默认值: True

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

返回

LightGBM 回归量模型的参数。

predict

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

predict(X)

参数

X
ndarray
必需

输入数据。

返回

来自 LightGBM 分类器模型的预测值。

predict_proba

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

predict_proba(X)

参数

X
ndarray
必需

输入数据。

返回

来自 LightGBM 分类器模型的预测概率值。

属性

DEFAULT_MIN_DATA_IN_LEAF

DEFAULT_MIN_DATA_IN_LEAF = 20