-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathregressor_cuml.py
139 lines (107 loc) · 3.79 KB
/
regressor_cuml.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# -*- coding: utf-8 -*-
"""This file is part of the TPOT library.
TPOT was primarily developed at the University of Pennsylvania by:
- Randal S. Olson (rso@randalolson.com)
- Weixuan Fu (weixuanf@upenn.edu)
- Daniel Angell (dpa34@drexel.edu)
- and many more generous open source contributors
TPOT is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
TPOT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with TPOT. If not, see <http://www.gnu.org/licenses/>.
"""
import numpy as np
# This configuration provides users with access to a GPU the ability to
# use RAPIDS cuML and DMLC/XGBoost regressors as estimators alongside
# the scikit-learn preprocessors in the TPOT default configuration.
regressor_config_cuml = {
# cuML + DMLC/XGBoost Regressors
"cuml.linear_model.ElasticNet": {
"l1_ratio": np.arange(0.0, 1.01, 0.05),
"tol": [1e-5, 1e-4, 1e-3, 1e-2, 1e-1]
},
"cuml.neighbors.KNeighborsRegressor": {
"n_neighbors": range(1, 101),
"weights": ["uniform"],
},
"cuml.linear_model.Lasso": {
"normalize": [True, False]
},
"cuml.linear_model.Ridge": {
},
"xgboost.XGBRegressor": {
"n_estimators": [100],
"max_depth": range(3, 10),
"learning_rate": [1e-2, 1e-1, 0.5, 1.],
"subsample": np.arange(0.05, 1.01, 0.05),
"min_child_weight": range(1, 21),
"alpha": [1, 10],
"tree_method": ["gpu_hist"],
"n_jobs": [1],
"verbosity": [0],
"objective": ["reg:squarederror"]
},
# Sklearn Preprocesssors
"sklearn.preprocessing.Binarizer": {
"threshold": np.arange(0.0, 1.01, 0.05)
},
"sklearn.decomposition.FastICA": {
"tol": np.arange(0.0, 1.01, 0.05)
},
"sklearn.cluster.FeatureAgglomeration": {
"linkage": ["ward", "complete", "average"],
"affinity": ["euclidean", "l1", "l2", "manhattan", "cosine"]
},
"sklearn.preprocessing.MaxAbsScaler": {
},
"sklearn.preprocessing.MinMaxScaler": {
},
"sklearn.preprocessing.Normalizer": {
"norm": ["l1", "l2", "max"]
},
"sklearn.kernel_approximation.Nystroem": {
"kernel": ["rbf", "cosine", "chi2", "laplacian", "polynomial", "poly", "linear", "additive_chi2", "sigmoid"],
"gamma": np.arange(0.0, 1.01, 0.05),
"n_components": range(1, 11)
},
"sklearn.decomposition.PCA": {
"svd_solver": ["randomized"],
"iterated_power": range(1, 11)
},
"sklearn.kernel_approximation.RBFSampler": {
"gamma": np.arange(0.0, 1.01, 0.05)
},
"sklearn.preprocessing.RobustScaler": {
},
"sklearn.preprocessing.StandardScaler": {
},
"tpot.builtins.ZeroCount": {
},
"tpot.builtins.OneHotEncoder": {
"minimum_fraction": [0.05, 0.1, 0.15, 0.2, 0.25],
"sparse": [False],
"threshold": [10]
},
# Selectors
"sklearn.feature_selection.SelectFwe": {
"alpha": np.arange(0, 0.05, 0.001),
"score_func": {
"sklearn.feature_selection.f_classif": None
}
},
"sklearn.feature_selection.SelectPercentile": {
"percentile": range(1, 100),
"score_func": {
"sklearn.feature_selection.f_classif": None
}
},
"sklearn.feature_selection.VarianceThreshold": {
"threshold": [0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1, 0.2]
}
}