本文整理汇总了Python中lightgbm.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python lightgbm.__version__方法的具体用法?Python lightgbm.__version__怎么用?Python lightgbm.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lightgbm
的用法示例。
在下文中一共展示了lightgbm.__version__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import lightgbm [as 别名]
# 或者: from lightgbm import __version__ [as 别名]
def __init__(self, params):
super(LightgbmAlgorithm, self).__init__(params)
self.library_version = lgb.__version__
self.explain_level = params.get("explain_level", 0)
self.rounds = additional.get("max_rounds", 10000)
self.max_iters = 1
self.early_stopping_rounds = additional.get("early_stopping_rounds", 50)
self.learner_params = {
"boosting_type": "gbdt",
"objective": self.params.get("objective", "binary"),
"metric": self.params.get("metric", "binary_logloss"),
"num_threads": multiprocessing.cpu_count(),
"num_leaves": self.params.get("num_leaves", 31),
"learning_rate": self.params.get("learning_rate", 0.1),
"feature_fraction": self.params.get("feature_fraction", 1.0),
"bagging_fraction": self.params.get("bagging_fraction", 1.0),
"min_data_in_leaf": self.params.get("min_data_in_leaf", 20),
"verbose": -1,
"seed": self.params.get("seed", 1),
}
if "num_class" in self.params: # multiclass classification
self.learner_params["num_class"] = self.params.get("num_class")
logger.debug("LightgbmLearner __init__")
示例2: get_default_conda_env
# 需要导入模块: import lightgbm [as 别名]
# 或者: from lightgbm import __version__ [as 别名]
def get_default_conda_env():
"""
:return: The default Conda environment for MLflow Models produced by calls to
:func:`save_model()` and :func:`log_model()`.
"""
import lightgbm as lgb
return _mlflow_conda_env(
additional_conda_deps=None,
# LightGBM is not yet available via the default conda channels, so we install it via pip
additional_pip_deps=[
"lightgbm=={}".format(lgb.__version__),
],
additional_conda_channels=None)