本文整理匯總了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)