From f841337972a594a412228345e8e0f6d47c62fe43 Mon Sep 17 00:00:00 2001 From: Ankit <57462844+ankitrajixr@users.noreply.github.com> Date: Wed, 17 Mar 2021 18:55:28 +0100 Subject: [PATCH 1/4] add custom regressor classifer #1186 --- tpot/config/classifier.py | 22 ++++++++++++++++++++-- tpot/config/regressor.py | 16 +++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/tpot/config/classifier.py b/tpot/config/classifier.py index f720d850..22a4b3c3 100644 --- a/tpot/config/classifier.py +++ b/tpot/config/classifier.py @@ -24,7 +24,7 @@ """ import numpy as np - +from sklearn.gaussian_process.kernels import WhiteKernel, Matern, RBF, DotProduct, RationalQuadratic, ExpSineSquared # Check the TPOT documentation for information on the structure of config dicts classifier_config_dict = { @@ -123,7 +123,25 @@ 'alpha': [1e-4, 1e-3, 1e-2, 1e-1], 'learning_rate_init': [1e-3, 1e-2, 1e-1, 0.5, 1.] }, - + 'sklearn.gaussian_process.GaussianProcessClassifier': { + 'kernel' : [1.0*RBF(length_scale=0.5, length_scale_bounds=(1e-05, 100000.0)), + 1.0*RationalQuadratic(length_scale=0.5, alpha=0.1), + 1.0*ExpSineSquared(length_scale=0.5, periodicity=3.0, + length_scale_bounds=(1e-05, 100000.0), + periodicity_bounds=(1.0, 10.0)), + ConstantKernel(0.1, (0.01, 10.0))*(DotProduct(sigma_0=1.0, sigma_0_bounds=(0.1, 10.0)) ** 2), + 1.0**2*Matern(length_scale=0.5, length_scale_bounds=(1e-05, 100000.0), + nu=0.5)], + 'alpha': [5e-9,1e-3, 1e-2, 1e-1, 1., 10., 100.], + 'normalize_y' : [True, False], + 'optimizer' : ['fmin_l_bfgs_b'] + + 'sklearn.ensemble.AdaBoostClassifier': { + 'n_estimators': [100], + 'learning_rate': [1e-3, 1e-2, 1e-1, 0.5, 1.], + 'loss': ["linear", "square", "exponential"] + }, + # Preprocesssors 'sklearn.preprocessing.Binarizer': { 'threshold': np.arange(0.0, 1.01, 0.05) diff --git a/tpot/config/regressor.py b/tpot/config/regressor.py index 8e9d2eb7..4c0d6a8d 100644 --- a/tpot/config/regressor.py +++ b/tpot/config/regressor.py @@ -24,7 +24,7 @@ """ import numpy as np - +from sklearn.gaussian_process.kernels import WhiteKernel, Matern, RBF, DotProduct, RationalQuadratic, ExpSineSquared # Check the TPOT documentation for information on the structure of config dicts regressor_config_dict = { @@ -117,6 +117,20 @@ 'power_t': [0.5, 0.0, 1.0, 0.1, 100.0, 10.0, 50.0] }, + 'sklearn.gaussian_process.GaussianProcessRegressor': { + 'kernel' : [1.0*RBF(length_scale=0.5, length_scale_bounds=(1e-05, 100000.0)), + 1.0*RationalQuadratic(length_scale=0.5, alpha=0.1), + 1.0*ExpSineSquared(length_scale=0.5, periodicity=3.0, + length_scale_bounds=(1e-05, 100000.0), + periodicity_bounds=(1.0, 10.0)), + ConstantKernel(0.1, (0.01, 10.0))*(DotProduct(sigma_0=1.0, sigma_0_bounds=(0.1, 10.0)) ** 2), + 1.0**2*Matern(length_scale=0.5, length_scale_bounds=(1e-05, 100000.0), + nu=0.5)], + 'alpha': [5e-9,1e-3, 1e-2, 1e-1, 1., 10., 100.], + 'normalize_y' : [True, False], + 'optimizer' : ['fmin_l_bfgs_b'] + } +} # Preprocessors 'sklearn.preprocessing.Binarizer': { 'threshold': np.arange(0.0, 1.01, 0.05) From 732ce052d36995845e374fb9b0bc2bac204e3eba Mon Sep 17 00:00:00 2001 From: Ankit <57462844+ankitrajixr@users.noreply.github.com> Date: Wed, 17 Mar 2021 22:42:39 +0100 Subject: [PATCH 2/4] Update regressor.py --- tpot/config/regressor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpot/config/regressor.py b/tpot/config/regressor.py index 4c0d6a8d..1c91418a 100644 --- a/tpot/config/regressor.py +++ b/tpot/config/regressor.py @@ -24,7 +24,7 @@ """ import numpy as np -from sklearn.gaussian_process.kernels import WhiteKernel, Matern, RBF, DotProduct, RationalQuadratic, ExpSineSquared +from sklearn.gaussian_process.kernels import WhiteKernel, Matern, RBF, DotProduct, RationalQuadratic, ExpSineSquared, ConstantKernel # Check the TPOT documentation for information on the structure of config dicts regressor_config_dict = { From 88d62e7cb01cc6675f8931d28eedab1165806bd8 Mon Sep 17 00:00:00 2001 From: Ankit <57462844+ankitrajixr@users.noreply.github.com> Date: Wed, 17 Mar 2021 22:44:11 +0100 Subject: [PATCH 3/4] Update classifier.py --- tpot/config/classifier.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tpot/config/classifier.py b/tpot/config/classifier.py index 22a4b3c3..c820d730 100644 --- a/tpot/config/classifier.py +++ b/tpot/config/classifier.py @@ -24,7 +24,7 @@ """ import numpy as np -from sklearn.gaussian_process.kernels import WhiteKernel, Matern, RBF, DotProduct, RationalQuadratic, ExpSineSquared +from sklearn.gaussian_process.kernels import WhiteKernel, Matern, RBF, DotProduct, RationalQuadratic, ExpSineSquared, ConstantKernel # Check the TPOT documentation for information on the structure of config dicts classifier_config_dict = { @@ -123,6 +123,7 @@ 'alpha': [1e-4, 1e-3, 1e-2, 1e-1], 'learning_rate_init': [1e-3, 1e-2, 1e-1, 0.5, 1.] }, + 'sklearn.gaussian_process.GaussianProcessClassifier': { 'kernel' : [1.0*RBF(length_scale=0.5, length_scale_bounds=(1e-05, 100000.0)), 1.0*RationalQuadratic(length_scale=0.5, alpha=0.1), @@ -135,6 +136,7 @@ 'alpha': [5e-9,1e-3, 1e-2, 1e-1, 1., 10., 100.], 'normalize_y' : [True, False], 'optimizer' : ['fmin_l_bfgs_b'] + }, 'sklearn.ensemble.AdaBoostClassifier': { 'n_estimators': [100], From 26460c8b626f6fef26f9890d227f522e3e4135c7 Mon Sep 17 00:00:00 2001 From: Ankit <57462844+ankitrajixr@users.noreply.github.com> Date: Wed, 17 Mar 2021 22:46:32 +0100 Subject: [PATCH 4/4] Update regressor.py --- tpot/config/regressor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tpot/config/regressor.py b/tpot/config/regressor.py index 1c91418a..e94f1261 100644 --- a/tpot/config/regressor.py +++ b/tpot/config/regressor.py @@ -129,8 +129,8 @@ 'alpha': [5e-9,1e-3, 1e-2, 1e-1, 1., 10., 100.], 'normalize_y' : [True, False], 'optimizer' : ['fmin_l_bfgs_b'] - } -} + }, + # Preprocessors 'sklearn.preprocessing.Binarizer': { 'threshold': np.arange(0.0, 1.01, 0.05)