MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / __init__

Method __init__

python-package/lightgbmmt/sklearn.py:172–329  ·  view source on GitHub ↗

r"""Construct a gradient boosting model. Parameters ---------- boosting_type : string, optional (default='gbdt') 'gbdt', traditional Gradient Boosting Decision Tree. 'dart', Dropouts meet Multiple Additive Regression Trees. 'goss', Gradien

(self, boosting_type='gbdt', num_leaves=31, max_depth=-1,
                 learning_rate=0.1, n_estimators=100,
                 subsample_for_bin=200000, objective=None, class_weight=None,
                 min_split_gain=0., min_child_weight=1e-3, min_child_samples=20,
                 subsample=1., subsample_freq=0, colsample_bytree=1.,
                 reg_alpha=0., reg_lambda=0., random_state=None,
                 n_jobs=-1, silent=True, importance_type='split', **kwargs)

Source from the content-addressed store, hash-verified

170 """Implementation of the scikit-learn API for LightGBM."""
171
172 def __init__(self, boosting_type='gbdt', num_leaves=31, max_depth=-1,
173 learning_rate=0.1, n_estimators=100,
174 subsample_for_bin=200000, objective=None, class_weight=None,
175 min_split_gain=0., min_child_weight=1e-3, min_child_samples=20,
176 subsample=1., subsample_freq=0, colsample_bytree=1.,
177 reg_alpha=0., reg_lambda=0., random_state=None,
178 n_jobs=-1, silent=True, importance_type='split', **kwargs):
179 r"""Construct a gradient boosting model.
180
181 Parameters
182 ----------
183 boosting_type : string, optional (default='gbdt')
184 'gbdt', traditional Gradient Boosting Decision Tree.
185 'dart', Dropouts meet Multiple Additive Regression Trees.
186 'goss', Gradient-based One-Side Sampling.
187 'rf', Random Forest.
188 num_leaves : int, optional (default=31)
189 Maximum tree leaves for base learners.
190 max_depth : int, optional (default=-1)
191 Maximum tree depth for base learners, <=0 means no limit.
192 learning_rate : float, optional (default=0.1)
193 Boosting learning rate.
194 You can use ``callbacks`` parameter of ``fit`` method to shrink/adapt learning rate
195 in training using ``reset_parameter`` callback.
196 Note, that this will ignore the ``learning_rate`` argument in training.
197 n_estimators : int, optional (default=100)
198 Number of boosted trees to fit.
199 subsample_for_bin : int, optional (default=200000)
200 Number of samples for constructing bins.
201 objective : string, callable or None, optional (default=None)
202 Specify the learning task and the corresponding learning objective or
203 a custom objective function to be used (see note below).
204 Default: 'regression' for LGBMRegressor, 'binary' or 'multiclass' for LGBMClassifier, 'lambdarank' for LGBMRanker.
205 class_weight : dict, 'balanced' or None, optional (default=None)
206 Weights associated with classes in the form ``{class_label: weight}``.
207 Use this parameter only for multi-class classification task;
208 for binary classification task you may use ``is_unbalance`` or ``scale_pos_weight`` parameters.
209 Note, that the usage of all these parameters will result in poor estimates of the individual class probabilities.
210 You may want to consider performing probability calibration
211 (https://scikit-learn.org/stable/modules/calibration.html) of your model.
212 The 'balanced' mode uses the values of y to automatically adjust weights
213 inversely proportional to class frequencies in the input data as ``n_samples / (n_classes * np.bincount(y))``.
214 If None, all classes are supposed to have weight one.
215 Note, that these weights will be multiplied with ``sample_weight`` (passed through the ``fit`` method)
216 if ``sample_weight`` is specified.
217 min_split_gain : float, optional (default=0.)
218 Minimum loss reduction required to make a further partition on a leaf node of the tree.
219 min_child_weight : float, optional (default=1e-3)
220 Minimum sum of instance weight (hessian) needed in a child (leaf).
221 min_child_samples : int, optional (default=20)
222 Minimum number of data needed in a child (leaf).
223 subsample : float, optional (default=1.)
224 Subsample ratio of the training instance.
225 subsample_freq : int, optional (default=0)
226 Frequence of subsample, <=0 means no enable.
227 colsample_bytree : float, optional (default=1.)
228 Subsample ratio of columns when constructing each tree.
229 reg_alpha : float, optional (default=0.)

Callers

nothing calls this directly

Calls 2

set_paramsMethod · 0.95
LightGBMErrorClass · 0.85

Tested by

no test coverage detected