From 584ee1913c15d6f61c656684bf9cf71a4f7000c3 Mon Sep 17 00:00:00 2001 From: Vinay D Date: Thu, 27 May 2021 08:53:17 +0530 Subject: [PATCH 1/2] Launching sklearn RF fit with multi-thread support --- algorithms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/algorithms.py b/algorithms.py index 7c51970..ed55e5a 100644 --- a/algorithms.py +++ b/algorithms.py @@ -150,7 +150,7 @@ def __exit__(self, exc_type, exc_value, traceback): # learning parameters shared by all algorithms, using the xgboost convention shared_params = {"max_depth": 8, "learning_rate": 0.1, - "reg_lambda": 1} + "reg_lambda": 1, "max_samples" : 0.5} class CumlRfAlgorithm(Algorithm): def configure(self, data, args): @@ -222,6 +222,7 @@ def configure(self, data, args): del params["learning_rate"] params["n_estimators"] = args.ntrees params.update(args.extra) + params.update({"n_jobs" : -1}) return params def fit(self, data, args): From f879c7baa303c07930911afd4cba3b87ea82a976 Mon Sep 17 00:00:00 2001 From: Vinay D Date: Thu, 27 May 2021 08:54:13 +0530 Subject: [PATCH 2/2] Updating covtype dataset preprocessing to work with cuML --- datasets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datasets.py b/datasets.py index abb2bd3..7454c37 100644 --- a/datasets.py +++ b/datasets.py @@ -295,7 +295,11 @@ def prepare_covtype(dataset_folder, nrows): # pylint: disable=unused-argument if nrows is not None: X = X[0:nrows] y = y[0:nrows] + # Labele range in covtype start from 1, making it start from 0 + y = y - 1 + X = np.float32(X) + y = np.int32(y) X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=77, test_size=0.2, )