I encountered the following error when running ConfoundRegressor. I've tried using my own script as well as the example implementation provided. Any clue how to resolve this error?
Empty Traceback (most recent call last)
~/opt/anaconda3/lib/python3.8/site-packages/joblib/parallel.py in dispatch_one_batch(self, iterator)
821 try:
--> 822 tasks = self._ready_batches.get(block=False)
823 except queue.Empty:
~/opt/anaconda3/lib/python3.8/queue.py in get(self, block, timeout)
166 if not self._qsize():
--> 167 raise Empty
168 elif timeout is None:
Empty:
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
/var/folders/fb/fwsj02n54bd7zmtt541bh0140000gp/T/ipykernel_11101/2227739750.py in
15 pipeline = make_pipeline(cfr, clf)
16
---> 17 scores = cross_val_score(estimator=pipeline, X=X, y=y, cv=10)
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/model_selection/_validation.py in cross_val_score(estimator, X, y, groups, scoring, cv, n_jobs, verbose, fit_params, pre_dispatch, error_score)
443 scorer = check_scoring(estimator, scoring=scoring)
444
--> 445 cv_results = cross_validate(estimator=estimator, X=X, y=y, groups=groups,
446 scoring={'score': scorer}, cv=cv,
447 n_jobs=n_jobs, verbose=verbose,
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/model_selection/_validation.py in cross_validate(estimator, X, y, groups, scoring, cv, n_jobs, verbose, fit_params, pre_dispatch, return_train_score, return_estimator, error_score)
248 parallel = Parallel(n_jobs=n_jobs, verbose=verbose,
249 pre_dispatch=pre_dispatch)
--> 250 results = parallel(
251 delayed(_fit_and_score)(
252 clone(estimator), X, y, scorers, train, test, verbose, None,
~/opt/anaconda3/lib/python3.8/site-packages/joblib/parallel.py in call(self, iterable)
1041 # remaining jobs.
1042 self._iterating = False
-> 1043 if self.dispatch_one_batch(iterator):
1044 self._iterating = self._original_iterator is not None
1045
~/opt/anaconda3/lib/python3.8/site-packages/joblib/parallel.py in dispatch_one_batch(self, iterator)
831 big_batch_size = batch_size * n_jobs
832
--> 833 islice = list(itertools.islice(iterator, big_batch_size))
834 if len(islice) == 0:
835 return False
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/model_selection/_validation.py in (.0)
250 results = parallel(
251 delayed(_fit_and_score)(
--> 252 clone(estimator), X, y, scorers, train, test, verbose, None,
253 fit_params, return_train_score=return_train_score,
254 return_times=True, return_estimator=return_estimator,
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py in clone(estimator, safe)
74 new_object_params = estimator.get_params(deep=False)
75 for name, param in new_object_params.items():
---> 76 new_object_params[name] = clone(param, safe=False)
77 new_object = klass(**new_object_params)
78 params_set = new_object.get_params(deep=False)
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py in clone(estimator, safe)
55 # XXX: not handling dictionaries
56 if estimator_type in (list, tuple, set, frozenset):
---> 57 return estimator_type([clone(e, safe=safe) for e in estimator])
58 elif not hasattr(estimator, 'get_params') or isinstance(estimator, type):
59 if not safe:
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py in (.0)
55 # XXX: not handling dictionaries
56 if estimator_type in (list, tuple, set, frozenset):
---> 57 return estimator_type([clone(e, safe=safe) for e in estimator])
58 elif not hasattr(estimator, 'get_params') or isinstance(estimator, type):
59 if not safe:
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py in clone(estimator, safe)
55 # XXX: not handling dictionaries
56 if estimator_type in (list, tuple, set, frozenset):
---> 57 return estimator_type([clone(e, safe=safe) for e in estimator])
58 elif not hasattr(estimator, 'get_params') or isinstance(estimator, type):
59 if not safe:
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py in (.0)
55 # XXX: not handling dictionaries
56 if estimator_type in (list, tuple, set, frozenset):
---> 57 return estimator_type([clone(e, safe=safe) for e in estimator])
58 elif not hasattr(estimator, 'get_params') or isinstance(estimator, type):
59 if not safe:
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py in clone(estimator, safe)
72
73 klass = estimator.class
---> 74 new_object_params = estimator.get_params(deep=False)
75 for name, param in new_object_params.items():
76 new_object_params[name] = clone(param, safe=False)
~/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py in get_params(self, deep)
193 out = dict()
194 for key in self._get_param_names():
--> 195 value = getattr(self, key)
196 if deep and hasattr(value, 'get_params'):
197 deep_items = value.get_params().items()
AttributeError: 'ConfoundRegressor' object has no attribute 'X'