From 4c331dcd77c15a356690e5e5940cc30875607582 Mon Sep 17 00:00:00 2001 From: Dhruv Thakur <80753201+dhruvthakur2000@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:54:49 +0530 Subject: [PATCH] Update Task-Oriented-AutoML.md --- .../docs/Use-Cases/Task-Oriented-AutoML.md | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/website/docs/Use-Cases/Task-Oriented-AutoML.md b/website/docs/Use-Cases/Task-Oriented-AutoML.md index 13202a4d19..6a11be2d42 100644 --- a/website/docs/Use-Cases/Task-Oriented-AutoML.md +++ b/website/docs/Use-Cases/Task-Oriented-AutoML.md @@ -149,29 +149,27 @@ class MyRegularizedGreedyForest(SKLearnEstimator): super().__init__(task, **config) if task in CLASSIFICATION: - from rgf.sklearn import RGFClassifier - - self.estimator_class = RGFClassifier + from rgf.sklearn import RGFClassifier + self.estimator_class = RGFClassifier else: - from rgf.sklearn import RGFRegressor - - self.estimator_class = RGFRegressor + from rgf.sklearn import RGFRegressor + self.estimator_class = RGFRegressor @classmethod def search_space(cls, data_size, task): space = { - "max_leaf": { - "domain": tune.lograndint(lower=4, upper=data_size), - "low_cost_init_value": 4, - }, - "n_iter": { - "domain": tune.lograndint(lower=1, upper=data_size), - "low_cost_init_value": 1, - }, - "learning_rate": {"domain": tune.loguniform(lower=0.01, upper=20.0)}, - "min_samples_leaf": { - "domain": tune.lograndint(lower=1, upper=20), - "init_value": 20, + "max_leaf": { + "domain": tune.lograndint(lower=4, upper=data_size), + "low_cost_init_value": 4, + }, + "n_iter": { + "domain": tune.lograndint(lower=1, upper=data_size), + "low_cost_init_value": 1, + }, + "learning_rate": {"domain": tune.loguniform(lower=0.01, upper=20.0)}, + "min_samples_leaf": { + "domain": tune.lograndint(lower=1, upper=20), + "init_value": 20, }, } return space