sdkagent

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

KindCount
Classes18
Functions10
Methods60

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]) -> str
Construct code for auto config file for one param value.
classpython-package.lightgbm.basic.Booster
Booster in LightGBM.
funcpython-package.lightgbm.basic.Booster.add(root:Dict[str, Any]) -> None
Recursively add thresholds.
methodpython-package.lightgbm.basic.Booster.add_valid(data:Dataset, name:str) -> 'Booster'
Add validation data.
methodpython-package.lightgbm.basic.Booster.current_iteration() -> int
Get the index of the current iteration.
methodpython-package.lightgbm.basic.Booster.eval(data:Dataset, name:str, feval:Optional[Union[_LGBM_CustomEvalFunction, List[_LGBM_CustomEvalFunction]]]=None) -> List[EvalResult]
Evaluate for data.
methodpython-package.lightgbm.basic.Booster.eval_train(feval:Optional[Union[_LGBM_CustomEvalFunction, List[_LGBM_CustomEvalFunction]]]=None) -> List[EvalResult]
Evaluate for training data.
methodpython-package.lightgbm.basic.Booster.eval_valid(feval:Optional[Union[_LGBM_CustomEvalFunction, List[_LGBM_CustomEvalFunction]]]=None) -> List[EvalResult]
Evaluate for validation data.
methodpython-package.lightgbm.basic.Booster.feature_importance(importance_type:str='split', iteration:Optional[int]=None) -> np.ndarray
Get feature importances.
methodpython-package.lightgbm.basic.Booster.feature_name() -> List[str]
Get names of features.
methodpython-package.lightgbm.basic.Booster.free_dataset() -> 'Booster'
Free Booster's Datasets.
methodpython-package.lightgbm.basic.Booster.free_network() -> 'Booster'
Free Booster's network.
methodpython-package.lightgbm.basic.Booster.get_leaf_output(tree_id:int, leaf_id:int) -> float
Get the output of a leaf.
methodpython-package.lightgbm.basic.Booster.lower_bound() -> float
Get lower bound value of a model.
methodpython-package.lightgbm.basic.Booster.model_from_string(model_str:str) -> 'Booster'
Load Booster from a string.
methodpython-package.lightgbm.basic.Booster.model_to_string(num_iteration:Optional[int]=None, start_iteration:int=0, importance_type:str='split') -> str
Save Booster to string.
methodpython-package.lightgbm.basic.Booster.num_feature() -> int
Get number of features.
methodpython-package.lightgbm.basic.Booster.num_model_per_iteration() -> int
Get number of models per iteration.
methodpython-package.lightgbm.basic.Booster.num_trees() -> int
Get number of weak sub-models.
methodpython-package.lightgbm.basic.Booster.reset_parameter(params:Dict[str, Any]) -> 'Booster'
Reset parameters of Booster.
methodpython-package.lightgbm.basic.Booster.rollback_one_iter() -> 'Booster'
Rollback one iteration.
methodpython-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.
methodpython-package.lightgbm.basic.Booster.set_leaf_output(tree_id:int, leaf_id:int, value:float) -> 'Booster'
Set the output of a leaf.
methodpython-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.
methodpython-package.lightgbm.basic.Booster.set_train_data_name(name:str) -> 'Booster'
Set the name to the training Dataset.
methodpython-package.lightgbm.basic.Booster.shuffle_models(start_iteration:int=0, end_iteration:int=-1) -> 'Booster'
Shuffle models.
methodpython-package.lightgbm.basic.Booster.update(train_set:Optional[Dataset]=None, fobj:Optional[_LGBM_CustomObjectiveFunction]=None) -> bool
Update Booster for one iteration.
methodpython-package.lightgbm.basic.Booster.upper_bound() -> float
Get upper bound value of a model.
classpython-package.lightgbm.basic.Dataset
Dataset in LightGBM.
methodpython-package.lightgbm.basic.Dataset.add_features_from(other:'Dataset') -> 'Dataset'
Add features from other Dataset to the current Dataset.
methodpython-package.lightgbm.basic.Dataset.construct() -> 'Dataset'
Lazy init.
methodpython-package.lightgbm.basic.Dataset.feature_num_bin(feature:Union[int, str]) -> int
Get the number of bins for a feature.
methodpython-package.lightgbm.basic.Dataset.get_data() -> Optional[_LGBM_TrainDataType]
Get the raw data of the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_feature_name() -> List[str]
Get the names of columns (features) in the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_field(field_name:str) -> Optional[np.ndarray]
Get property from the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_group() -> Optional[_LGBM_GroupType]
Get the group of the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_init_score() -> Optional[_LGBM_InitScoreType]
Get the initial score of the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_label() -> Optional[_LGBM_LabelType]
Get the label of the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_params() -> Dict[str, Any]
Get the used parameters in the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_position() -> Optional[_LGBM_PositionType]
Get the position of the Dataset.
methodpython-package.lightgbm.basic.Dataset.get_ref_chain(ref_limit:int=100) -> Set['Dataset']
Get a chain of Dataset objects.
methodpython-package.lightgbm.basic.Dataset.get_weight() -> Optional[_LGBM_WeightType]
Get the weight of the Dataset.
methodpython-package.lightgbm.basic.Dataset.num_data() -> int
Get the number of rows in the Dataset.
methodpython-package.lightgbm.basic.Dataset.num_feature() -> int
Get the number of columns (features) in the Dataset.
methodpython-package.lightgbm.basic.Dataset.save_binary(filename:Union[str, Path]) -> 'Dataset'
Save Dataset to a binary file.
methodpython-package.lightgbm.basic.Dataset.set_categorical_feature(categorical_feature:_LGBM_CategoricalFeatureConfiguration) -> 'Dataset'
Set categorical features.
methodpython-package.lightgbm.basic.Dataset.set_feature_name(feature_name:_LGBM_FeatureNameConfiguration) -> 'Dataset'
Set feature name.
methodpython-package.lightgbm.basic.Dataset.set_field(field_name:str, data:Optional[_LGBM_SetFieldType]) -> 'Dataset'
Set property into the Dataset.
methodpython-package.lightgbm.basic.Dataset.set_group(group:Optional[_LGBM_GroupType]) -> 'Dataset'
Set group size of Dataset (used for ranking).
methodpython-package.lightgbm.basic.Dataset.set_init_score(init_score:Optional[_LGBM_InitScoreType]) -> 'Dataset'
Set init score of Booster to start from.
methodpython-package.lightgbm.basic.Dataset.set_label(label:Optional[_LGBM_LabelType]) -> 'Dataset'
Set label of Dataset.
methodpython-package.lightgbm.basic.Dataset.set_position(position:Optional[_LGBM_PositionType]) -> 'Dataset'
Set position of Dataset (used for ranking).
methodpython-package.lightgbm.basic.Dataset.set_reference(reference:'Dataset') -> 'Dataset'
Set reference Dataset.
methodpython-package.lightgbm.basic.Dataset.set_weight(weight:Optional[_LGBM_WeightType]) -> 'Dataset'
Set weight of each instance.
methodpython-package.lightgbm.basic.Dataset.subset(used_indices:List[int], params:Optional[Dict[str, Any]]=None) -> 'Dataset'
Get subset of current Dataset.
classpython-package.lightgbm.basic.EvalResult
Result from computing an evaluation metric on a dataset.
methodpython-package.lightgbm.basic.EvalResult.is_cv_result() -> bool
Whether the result was created by ``cv()``.
classpython-package.lightgbm.basic.LGBMDeprecationWarning
Custom deprecation warning.
classpython-package.lightgbm.basic.LightGBMError
Error thrown by LightGBM.
classpython-package.lightgbm.basic.Sequence
Generic data access interface.
funcpython-package.lightgbm.basic.register_logger(logger:Any, info_method_name:str='info', warning_method_name:str='warning') -> None
Register custom logger.
classpython-package.lightgbm.callback.EarlyStopException
Exception of early stopping.
funcpython-package.lightgbm.callback.log_evaluation(period:int=1, show_stdv:bool=True) -> _LogEvaluationCallback
Create a callback that logs the evaluation results.
classpython-package.lightgbm.compat.pd_CategoricalDtype
Dummy class for pandas.CategoricalDtype.
classpython-package.lightgbm.compat.pd_DataFrame
Dummy class for pandas.DataFrame.
classpython-package.lightgbm.compat.pd_Series
Dummy class for pandas.Series.
classpython-package.lightgbm.dask.DaskLGBMClassifier
Distributed version of lightgbm.LGBMClassifier.
classpython-package.lightgbm.dask.DaskLGBMRanker
Distributed version of lightgbm.LGBMRanker.
classpython-package.lightgbm.dask.DaskLGBMRegressor
Distributed version of lightgbm.LGBMRegressor.
classpython-package.lightgbm.engine.CVBooster
CVBooster in LightGBM.
methodpython-package.lightgbm.engine.CVBooster.model_from_string(model_str:str) -> 'CVBooster'
Load CVBooster from a string.
methodpython-package.lightgbm.engine.CVBooster.model_to_string(num_iteration:Optional[int]=None, start_iteration:int=0, importance_type:str='split') -> str
Save CVBooster to JSON string.
funcpython-package.lightgbm.plotting.add(root:Dict[str, Any], total_count:int, parent:Optional[str], decision:Optional[str], highlight:bool) -> None
Recursively add node or edge.
classpython-package.lightgbm.sklearn.LGBMClassifier
LightGBM classifier.
methodpython-package.lightgbm.sklearn.LGBMClassifier.n_classes_() -> int
:obj:`int`: The number of classes.
classpython-package.lightgbm.sklearn.LGBMModel
Implementation of the scikit-learn API for LightGBM.
methodpython-package.lightgbm.sklearn.LGBMModel.best_score_() -> _LGBM_BoosterBestScoreType
:obj:`dict`: The best score of fitted model.
methodpython-package.lightgbm.sklearn.LGBMModel.booster_() -> Booster
Booster: The underlying Booster of this model.
methodpython-package.lightgbm.sklearn.LGBMModel.get_params(deep:bool=True) -> Dict[str, Any]
Get parameters for this estimator.
methodpython-package.lightgbm.sklearn.LGBMModel.n_features_() -> int
:obj:`int`: The number of features of fitted model.
methodpython-package.lightgbm.sklearn.LGBMModel.set_params(**params:Any) -> 'LGBMModel'
Set the parameters of this estimator.
classpython-package.lightgbm.sklearn.LGBMRanker
LightGBM ranker.
classpython-package.lightgbm.sklearn.LGBMRegressor
LightGBM 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.

Back to all 805 libraries