Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[model:backout] TypeError: All intermediate steps should be transformers and implement fit and transform #3893

Closed
suhaibmujahid opened this issue Dec 5, 2023 · 1 comment · Fixed by #3894
Assignees
Labels
bug Something isn't working

Comments

@suhaibmujahid
Copy link
Member

Failing on bugbug integration test:

+ bugbug-train backout --limit 30000 --no-download
2023-12-05 17:34:09,725:INFO:scripts.trainer:Skipping download of the databases
2023-12-05 17:34:09,725:INFO:scripts.trainer:Training *backout* model
2023-12-05 17:34:09,781:INFO:bugbug.models.backout:157 commits were backed out
2023-12-05 17:34:09,781:INFO:bugbug.models.backout:299 commits were not backed out
2023-12-05 17:34:09,866:INFO:bugbug.model:X: (456, 3), y: (456,)
Traceback (most recent call last):
  File "/usr/local/bin/bugbug-train", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/scripts/trainer.py", line 141, in main
    retriever.go(args)
  File "/usr/local/lib/python3.10/site-packages/scripts/trainer.py", line 41, in go
    metrics = model_obj.train(limit=args.limit)
  File "/usr/local/lib/python3.10/site-packages/bugbug/model.py", line 399, in train
    scores = cross_validate(
  File "/usr/local/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 285, in cross_validate
    _warn_or_raise_about_fit_failures(results, error_score)
  File "/usr/local/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 367, in _warn_or_raise_about_fit_failures
    raise ValueError(all_fits_failed_message)
ValueError: 
All the 5 fits failed.
It is very likely that your model is misconfigured.
You can try to debug the error by setting error_score='raise'.

Below are more details about the failures:
--------------------------------------------------------------------------------
5 fits failed with the following error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 686, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/usr/local/lib/python3.10/site-packages/sklearn/pipeline.py", line 378, in fit
    Xt = self._fit(X, y, **fit_params_steps)
  File "/usr/local/lib/python3.10/site-packages/sklearn/pipeline.py", line 316, in _fit
    self._validate_steps()
  File "/usr/local/lib/python3.10/site-packages/sklearn/pipeline.py", line 207, in _validate_steps
    raise TypeError(
TypeError: All intermediate steps should be transformers and implement fit and transform or be the string 'passthrough' 'RandomUnderSampler(random_state=0)' (type <class 'imblearn.under_sampling._prototype_selection._random_under_sampler.RandomUnderSampler'>) doesn't
@suhaibmujahid suhaibmujahid added the bug Something isn't working label Dec 5, 2023
@suhaibmujahid suhaibmujahid self-assigned this Dec 5, 2023
@suhaibmujahid
Copy link
Member Author

Regressed by #3877

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant