Skip to content

Error when trying to use Gaussian process regressor #1218

@wayneking517

Description

@wayneking517

I hope that this question is allowed on this site.

I am trying to use pot to optimize a gaussian process regressor. As such, I need a custom config:

tpot_config = {
'kernel' : [1.0RBF(length_scale=0.5, length_scale_bounds=(1e-05, 100000.0)),
1.0
RationalQuadratic(length_scale=0.5, alpha=0.1),
1.0ExpSineSquared(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']
}
tpot = TPOTRegressor(generations=5,
population_size=50,
verbosity=2,
cv=5,
config_dict=tpot_config,
random_state=42)

When I launch the fit:
tpot.fit(X_train, y_train)

I get:

Warning: alpha is not available and will not be used by TPOT.
Warning: kernel is not available and will not be used by TPOT.
Warning: normalize_y is not available and will not be used by TPOT.
Warning: optimizer is not available and will not be used by TPOT.
/Users/lk/PycharmProjects/ANN/venv/lib/python3.7/site-packages/sklearn/utils/validation.py:63: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().
return f(*args, **kwargs)

Generation 1 - Current best internal CV score: -inf
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
exec(exp, global_vars, local_vars)
File "", line 1, in
File "/Users/lk/PycharmProjects/ANN/venv/lib/python3.7/site-packages/tpot/base.py", line 863, in fit
raise e
File "/Users/lk/PycharmProjects/ANN/venv/lib/python3.7/site-packages/tpot/base.py", line 854, in fit
self._update_top_pipeline()
File "/Users/lk/PycharmProjects/ANN/venv/lib/python3.7/site-packages/tpot/base.py", line 921, in _update_top_pipeline
sklearn_pipeline = self._toolbox.compile(expr=pipeline)
File "/Users/lk/PycharmProjects/ANN/venv/lib/python3.7/site-packages/tpot/base.py", line 1412, in _compile_to_sklearn
expr_to_tree(expr, self._pset), self.operators
File "/Users/lindaking/PycharmProjects/ANN/venv/lib/python3.7/site-packages/tpot/export_utils.py", line 365, in generate_pipeline_code
steps = _process_operator(pipeline_tree, operators)
File "/Users/lk/PycharmProjects/ANN/venv/lib/python3.7/site-packages/tpot/export_utils.py", line 401, in _process_operator
op_name = operator[0]
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions