LightGBM API reference
88 public APIs from LightGBM (lightgbm-org/LightGBM) — 18 classes, 10 functions, 60 methods. Signatures extracted by static analysis of the actual source.
Repository: lightgbm-org/LightGBM
| Kind | Count |
|---|---|
| Classes | 18 |
| Functions | 10 |
| Methods | 60 |
API list
func
.ci.parameter-generator.gen_parameter_code(config_hpp:Path, config_out_cpp:Path) -> Tuple[List[Tuple[str, int]], List[List[Dict[str, List]]]]Generate auto config file.
func
.ci.parameter-generator.get_alias(infos:List[List[Dict[str, List]]]) -> List[Tuple[str, str]]Get aliases of all parameters.
func
.ci.parameter-generator.get_names(infos:List[List[Dict[str, List]]]) -> List[str]Get names of all parameters.
func
.ci.parameter-generator.get_parameter_infos(config_hpp:Path) -> Tuple[List[Tuple[str, int]], List[List[Dict[str, List]]]]Parse config header file.
func
.ci.parameter-generator.parse_check(check:str, reverse:bool=False) -> Tuple[str, str]Parse the constraint.
func
.ci.parameter-generator.set_one_var_from_string(name:str, param_type:str, checks:List[str]) -> strConstruct code for auto config file for one param value.
class
python-package.lightgbm.basic.BoosterBooster in LightGBM.
func
python-package.lightgbm.basic.Booster.add(root:Dict[str, Any]) -> NoneRecursively add thresholds.
method
python-package.lightgbm.basic.Booster.add_valid(data:Dataset, name:str) -> 'Booster'Add validation data.
method
python-package.lightgbm.basic.Booster.current_iteration() -> intGet the index of the current iteration.
method
python-package.lightgbm.basic.Booster.eval(data:Dataset, name:str, feval:Optional[Union[_LGBM_CustomEvalFunction, List[_LGBM_CustomEvalFunction]]]=None) -> List[EvalResult]Evaluate for data.
method
python-package.lightgbm.basic.Booster.eval_train(feval:Optional[Union[_LGBM_CustomEvalFunction, List[_LGBM_CustomEvalFunction]]]=None) -> List[EvalResult]Evaluate for training data.
method
python-package.lightgbm.basic.Booster.eval_valid(feval:Optional[Union[_LGBM_CustomEvalFunction, List[_LGBM_CustomEvalFunction]]]=None) -> List[EvalResult]Evaluate for validation data.
method
python-package.lightgbm.basic.Booster.feature_importance(importance_type:str='split', iteration:Optional[int]=None) -> np.ndarrayGet feature importances.
method
python-package.lightgbm.basic.Booster.feature_name() -> List[str]Get names of features.
method
python-package.lightgbm.basic.Booster.free_dataset() -> 'Booster'Free Booster's Datasets.
method
python-package.lightgbm.basic.Booster.free_network() -> 'Booster'Free Booster's network.
method
python-package.lightgbm.basic.Booster.get_leaf_output(tree_id:int, leaf_id:int) -> floatGet the output of a leaf.
method
python-package.lightgbm.basic.Booster.lower_bound() -> floatGet lower bound value of a model.
method
python-package.lightgbm.basic.Booster.model_from_string(model_str:str) -> 'Booster'Load Booster from a string.
method
python-package.lightgbm.basic.Booster.model_to_string(num_iteration:Optional[int]=None, start_iteration:int=0, importance_type:str='split') -> strSave Booster to string.
method
python-package.lightgbm.basic.Booster.num_feature() -> intGet number of features.
method
python-package.lightgbm.basic.Booster.num_model_per_iteration() -> intGet number of models per iteration.
method
python-package.lightgbm.basic.Booster.num_trees() -> intGet number of weak sub-models.
method
python-package.lightgbm.basic.Booster.reset_parameter(params:Dict[str, Any]) -> 'Booster'Reset parameters of Booster.
method
python-package.lightgbm.basic.Booster.rollback_one_iter() -> 'Booster'Rollback one iteration.
method
python-package.lightgbm.basic.Booster.save_model(filename:Union[str, Path], num_iteration:Optional[int]=None, start_iteration:int=0, importance_type:str='split') -> 'Booster'Save Booster to file.
method
python-package.lightgbm.basic.Booster.set_leaf_output(tree_id:int, leaf_id:int, value:float) -> 'Booster'Set the output of a leaf.
method
python-package.lightgbm.basic.Booster.set_network(machines:Union[List[str], Set[str], str], local_listen_port:int=12400, listen_time_out:int=120, num_machines:int=1) -> 'Booster'Set the network configuration.
method
python-package.lightgbm.basic.Booster.set_train_data_name(name:str) -> 'Booster'Set the name to the training Dataset.
method
python-package.lightgbm.basic.Booster.shuffle_models(start_iteration:int=0, end_iteration:int=-1) -> 'Booster'Shuffle models.
method
python-package.lightgbm.basic.Booster.update(train_set:Optional[Dataset]=None, fobj:Optional[_LGBM_CustomObjectiveFunction]=None) -> boolUpdate Booster for one iteration.
method
python-package.lightgbm.basic.Booster.upper_bound() -> floatGet upper bound value of a model.
class
python-package.lightgbm.basic.DatasetDataset in LightGBM.
method
python-package.lightgbm.basic.Dataset.add_features_from(other:'Dataset') -> 'Dataset'Add features from other Dataset to the current Dataset.
method
python-package.lightgbm.basic.Dataset.construct() -> 'Dataset'Lazy init.
method
python-package.lightgbm.basic.Dataset.feature_num_bin(feature:Union[int, str]) -> intGet the number of bins for a feature.
method
python-package.lightgbm.basic.Dataset.get_data() -> Optional[_LGBM_TrainDataType]Get the raw data of the Dataset.
method
python-package.lightgbm.basic.Dataset.get_feature_name() -> List[str]Get the names of columns (features) in the Dataset.
method
python-package.lightgbm.basic.Dataset.get_field(field_name:str) -> Optional[np.ndarray]Get property from the Dataset.
method
python-package.lightgbm.basic.Dataset.get_group() -> Optional[_LGBM_GroupType]Get the group of the Dataset.
method
python-package.lightgbm.basic.Dataset.get_init_score() -> Optional[_LGBM_InitScoreType]Get the initial score of the Dataset.
method
python-package.lightgbm.basic.Dataset.get_label() -> Optional[_LGBM_LabelType]Get the label of the Dataset.
method
python-package.lightgbm.basic.Dataset.get_params() -> Dict[str, Any]Get the used parameters in the Dataset.
method
python-package.lightgbm.basic.Dataset.get_position() -> Optional[_LGBM_PositionType]Get the position of the Dataset.
method
python-package.lightgbm.basic.Dataset.get_ref_chain(ref_limit:int=100) -> Set['Dataset']Get a chain of Dataset objects.
method
python-package.lightgbm.basic.Dataset.get_weight() -> Optional[_LGBM_WeightType]Get the weight of the Dataset.
method
python-package.lightgbm.basic.Dataset.num_data() -> intGet the number of rows in the Dataset.
method
python-package.lightgbm.basic.Dataset.num_feature() -> intGet the number of columns (features) in the Dataset.
method
python-package.lightgbm.basic.Dataset.save_binary(filename:Union[str, Path]) -> 'Dataset'Save Dataset to a binary file.
method
python-package.lightgbm.basic.Dataset.set_categorical_feature(categorical_feature:_LGBM_CategoricalFeatureConfiguration) -> 'Dataset'Set categorical features.
method
python-package.lightgbm.basic.Dataset.set_feature_name(feature_name:_LGBM_FeatureNameConfiguration) -> 'Dataset'Set feature name.
method
python-package.lightgbm.basic.Dataset.set_field(field_name:str, data:Optional[_LGBM_SetFieldType]) -> 'Dataset'Set property into the Dataset.
method
python-package.lightgbm.basic.Dataset.set_group(group:Optional[_LGBM_GroupType]) -> 'Dataset'Set group size of Dataset (used for ranking).
method
python-package.lightgbm.basic.Dataset.set_init_score(init_score:Optional[_LGBM_InitScoreType]) -> 'Dataset'Set init score of Booster to start from.
method
python-package.lightgbm.basic.Dataset.set_label(label:Optional[_LGBM_LabelType]) -> 'Dataset'Set label of Dataset.
method
python-package.lightgbm.basic.Dataset.set_position(position:Optional[_LGBM_PositionType]) -> 'Dataset'Set position of Dataset (used for ranking).
method
python-package.lightgbm.basic.Dataset.set_reference(reference:'Dataset') -> 'Dataset'Set reference Dataset.
method
python-package.lightgbm.basic.Dataset.set_weight(weight:Optional[_LGBM_WeightType]) -> 'Dataset'Set weight of each instance.
method
python-package.lightgbm.basic.Dataset.subset(used_indices:List[int], params:Optional[Dict[str, Any]]=None) -> 'Dataset'Get subset of current Dataset.
class
python-package.lightgbm.basic.EvalResultResult from computing an evaluation metric on a dataset.
method
python-package.lightgbm.basic.EvalResult.is_cv_result() -> boolWhether the result was created by ``cv()``.
class
python-package.lightgbm.basic.LGBMDeprecationWarningCustom deprecation warning.
class
python-package.lightgbm.basic.LightGBMErrorError thrown by LightGBM.
class
python-package.lightgbm.basic.SequenceGeneric data access interface.
func
python-package.lightgbm.basic.register_logger(logger:Any, info_method_name:str='info', warning_method_name:str='warning') -> NoneRegister custom logger.
class
python-package.lightgbm.callback.EarlyStopExceptionException of early stopping.
func
python-package.lightgbm.callback.log_evaluation(period:int=1, show_stdv:bool=True) -> _LogEvaluationCallbackCreate a callback that logs the evaluation results.
class
python-package.lightgbm.compat.pd_CategoricalDtypeDummy class for pandas.CategoricalDtype.
class
python-package.lightgbm.compat.pd_DataFrameDummy class for pandas.DataFrame.
class
python-package.lightgbm.compat.pd_SeriesDummy class for pandas.Series.
class
python-package.lightgbm.dask.DaskLGBMClassifierDistributed version of lightgbm.LGBMClassifier.
class
python-package.lightgbm.dask.DaskLGBMRankerDistributed version of lightgbm.LGBMRanker.
class
python-package.lightgbm.dask.DaskLGBMRegressorDistributed version of lightgbm.LGBMRegressor.
class
python-package.lightgbm.engine.CVBoosterCVBooster in LightGBM.
method
python-package.lightgbm.engine.CVBooster.model_from_string(model_str:str) -> 'CVBooster'Load CVBooster from a string.
method
python-package.lightgbm.engine.CVBooster.model_to_string(num_iteration:Optional[int]=None, start_iteration:int=0, importance_type:str='split') -> strSave CVBooster to JSON string.
func
python-package.lightgbm.plotting.add(root:Dict[str, Any], total_count:int, parent:Optional[str], decision:Optional[str], highlight:bool) -> NoneRecursively add node or edge.
class
python-package.lightgbm.sklearn.LGBMClassifierLightGBM classifier.
method
python-package.lightgbm.sklearn.LGBMClassifier.n_classes_() -> int:obj:`int`: The number of classes.
class
python-package.lightgbm.sklearn.LGBMModelImplementation of the scikit-learn API for LightGBM.
method
python-package.lightgbm.sklearn.LGBMModel.best_score_() -> _LGBM_BoosterBestScoreType:obj:`dict`: The best score of fitted model.
method
python-package.lightgbm.sklearn.LGBMModel.booster_() -> BoosterBooster: The underlying Booster of this model.
method
python-package.lightgbm.sklearn.LGBMModel.get_params(deep:bool=True) -> Dict[str, Any]Get parameters for this estimator.
method
python-package.lightgbm.sklearn.LGBMModel.n_features_() -> int:obj:`int`: The number of features of fitted model.
method
python-package.lightgbm.sklearn.LGBMModel.set_params(**params:Any) -> 'LGBMModel'Set the parameters of this estimator.
class
python-package.lightgbm.sklearn.LGBMRankerLightGBM ranker.
class
python-package.lightgbm.sklearn.LGBMRegressorLightGBM regressor.
About this data
These signatures were extracted from the public source of lightgbm-org/LightGBM
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.