Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
lightgbm.sklearn.LGBMClassifier Class Reference
Inheritance diagram for lightgbm.sklearn.LGBMClassifier:
lightgbm.sklearn.LGBMModel

Public Member Functions

 fit (self, X, y, sample_weight=None, init_score=None, eval_set=None, eval_names=None, eval_sample_weight=None, eval_class_weight=None, eval_init_score=None, eval_metric=None, early_stopping_rounds=None, verbose=True, feature_name='auto', categorical_feature='auto', callbacks=None)
 
 predict (self, X, raw_score=False, num_iteration=None, pred_leaf=False, pred_contrib=False, **kwargs)
 
 predict_proba (self, X, raw_score=False, num_iteration=None, pred_leaf=False, pred_contrib=False, **kwargs)
 
 classes_ (self)
 
 n_classes_ (self)
 
- Public Member Functions inherited from lightgbm.sklearn.LGBMModel
 __init__ (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)
 
 get_params (self, deep=True)
 
 set_params (self, **params)
 
 n_features_ (self)
 
 best_score_ (self)
 
 best_iteration_ (self)
 
 objective_ (self)
 
 booster_ (self)
 
 evals_result_ (self)
 
 feature_importances_ (self)
 

Protected Attributes

 _le
 
 _classes
 
 _n_classes
 
 _objective
 
- Protected Attributes inherited from lightgbm.sklearn.LGBMModel
 _Booster
 
 _evals_result
 
 _best_score
 
 _best_iteration
 
 _other_params
 
 _objective
 
 _n_features
 
 _classes
 
 _n_classes
 
 _fobj
 

Additional Inherited Members

- Data Fields inherited from lightgbm.sklearn.LGBMModel
 boosting_type
 
 objective
 
 num_leaves
 
 max_depth
 
 learning_rate
 
 n_estimators
 
 subsample_for_bin
 
 min_split_gain
 
 min_child_weight
 
 min_child_samples
 
 subsample
 
 subsample_freq
 
 colsample_bytree
 
 reg_alpha
 
 reg_lambda
 
 random_state
 
 n_jobs
 
 silent
 
 importance_type
 
 class_weight
 

Detailed Description

LightGBM classifier.

Member Function Documentation

◆ classes_()

lightgbm.sklearn.LGBMClassifier.classes_ (   self)
Get the class label array.

◆ fit()

lightgbm.sklearn.LGBMClassifier.fit (   self,
  X,
  y,
  sample_weight = None,
  init_score = None,
  eval_set = None,
  eval_names = None,
  eval_sample_weight = None,
  eval_class_weight = None,
  eval_init_score = None,
  eval_metric = None,
  early_stopping_rounds = None,
  verbose = True,
  feature_name = 'auto',
  categorical_feature = 'auto',
  callbacks = None 
)
Docstring is inherited from the LGBMModel.

Reimplemented from lightgbm.sklearn.LGBMModel.

◆ n_classes_()

lightgbm.sklearn.LGBMClassifier.n_classes_ (   self)
Get the number of classes.

◆ predict()

lightgbm.sklearn.LGBMClassifier.predict (   self,
  X,
  raw_score = False,
  num_iteration = None,
  pred_leaf = False,
  pred_contrib = False,
**  kwargs 
)
Docstring is inherited from the LGBMModel.

Reimplemented from lightgbm.sklearn.LGBMModel.

◆ predict_proba()

lightgbm.sklearn.LGBMClassifier.predict_proba (   self,
  X,
  raw_score = False,
  num_iteration = None,
  pred_leaf = False,
  pred_contrib = False,
**  kwargs 
)
Return the predicted probability for each class for each sample.

Parameters
----------
X : array-like or sparse matrix of shape = [n_samples, n_features]
    Input features matrix.
raw_score : bool, optional (default=False)
    Whether to predict raw scores.
num_iteration : int or None, optional (default=None)
    Limit number of iterations in the prediction.
    If None, if the best iteration exists, it is used; otherwise, all trees are used.
    If <= 0, all trees are used (no limits).
pred_leaf : bool, optional (default=False)
    Whether to predict leaf index.
pred_contrib : bool, optional (default=False)
    Whether to predict feature contributions.

    Note
    ----
    If you want to get more explanation for your model's predictions using SHAP values
    like SHAP interaction values,
    you can install shap package (https://github.com/slundberg/shap).

**kwargs
    Other parameters for the prediction.

Returns
-------
predicted_probability : array-like of shape = [n_samples, n_classes]
    The predicted probability for each class for each sample.
X_leaves : array-like of shape = [n_samples, n_trees * n_classes]
    If ``pred_leaf=True``, the predicted leaf every tree for each sample.
X_SHAP_values : array-like of shape = [n_samples, (n_features + 1) * n_classes]
    If ``pred_contrib=True``, the each feature contributions for each sample.

The documentation for this class was generated from the following file: