LightGBM notebook update (#690)

* version update in notebook

* comment about optuna install

* monotone constraints
This commit is contained in:
Chi Wang 2022-08-20 07:43:06 -07:00 committed by GitHub
parent e3d26c0650
commit 47e034d203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -39,7 +39,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"%pip install flaml[notebook]==1.0.8" "%pip install flaml[notebook]==1.0.10"
] ]
}, },
{ {
@ -651,6 +651,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# uncomment the following line if optuna is not installed\n",
"# %pip install optuna==2.8.0" "# %pip install optuna==2.8.0"
] ]
}, },

View File

@ -281,7 +281,9 @@ Some constraints on the estimator can be implemented via the custom learner. For
class MonotonicXGBoostEstimator(XGBoostSklearnEstimator): class MonotonicXGBoostEstimator(XGBoostSklearnEstimator):
@classmethod @classmethod
def search_space(**args): def search_space(**args):
return super().search_space(**args).update({"monotone_constraints": "(1, -1)"}) space = super().search_space(**args)
space.update({"monotone_constraints": {"domain": "(1, -1)"}})
return space
``` ```
It adds a monotonicity constraint to XGBoost. This approach can be used to set any constraint that is an argument in the underlying estimator's constructor. It adds a monotonicity constraint to XGBoost. This approach can be used to set any constraint that is an argument in the underlying estimator's constructor.