You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When combining MultioutputClassifier with an estimator that doesn't have sample_weight as metadata in the fit method, such as LinearDiscriminantAnalysis, it fails to fit.
Traceback (most recent call last):
File "C:\Users\Mavs\Documents\Python\ATOM\venv311\Lib\site-packages\IPython\core\interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-135dae0c8613>", line 10, in <module>
MultiOutputClassifier(LinearDiscriminantAnalysis()).fit(X, y)
File "C:\Users\Mavs\Documents\Python\ATOM\venv311\Lib\site-packages\sklearn\multioutput.py", line 535, in fit
super().fit(X, Y, sample_weight=sample_weight, **fit_params)
File "C:\Users\Mavs\Documents\Python\ATOM\venv311\Lib\site-packages\sklearn\base.py", line 1351, in wrapper
return fit_method(estimator, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Mavs\Documents\Python\ATOM\venv311\Lib\site-packages\sklearn\multioutput.py", line 251, in fit
routed_params = process_routing(
^^^^^^^^^^^^^^^^
File "C:\Users\Mavs\Documents\Python\ATOM\venv311\Lib\site-packages\sklearn\utils\_metadata_requests.py", line 1556, in process_routing
request_routing.validate_metadata(params=kwargs, method=_method)
File "C:\Users\Mavs\Documents\Python\ATOM\venv311\Lib\site-packages\sklearn\utils\_metadata_requests.py", line 1060, in validate_metadata
raise TypeError(
TypeError: MultiOutputClassifier.fit got unexpected argument(s) {'sample_weight'}, which are not requested metadata in any object.
Describe the bug
When combining
MultioutputClassifier
with an estimator that doesn't have sample_weight as metadata in thefit
method, such asLinearDiscriminantAnalysis
, it fails to fit.Steps/Code to Reproduce
Expected Results
No error thrown.
Actual Results
Versions
The text was updated successfully, but these errors were encountered: