ValueError: Cannot use median strategy with non-numeric data:
could not convert string to float: 'INLAND'
Detailed traceback:
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.12/site-packages/sklearn/base.py", line 1363, in wrapper
return fit_method(estimator, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sklearn/pipeline.py", line 653, in fit
Xt = self._fit(X, y, routed_params, raw_params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sklearn/pipeline.py", line 587, in _fit
X, fitted_transformer = fit_transform_one_cached(
So what do we do?
Drop the column (not recommended)
We can transform categorical features to numeric ones so that we can use them in the model