from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomForestRegressor from BorutaShap import BorutaShap
from sklearn.model_selection import cross_val_predict
pipe = Pipeline(steps=[("selector", BorutaShap()),
("Regressor", RandomForestRegressor())])
pipe.fit(X,y)
Problem
cross_val_predict is not supported yet
~\Anaconda3\envs\lib\site-packages\sklearn\pipeline.py in _fit_transform_one(transformer, X, y, weight, message_clsname, message, **fit_params)
891 res = transformer.fit_transform(X, y, **fit_params)
892 else:
--> 893 res = transformer.fit(X, y, **fit_params).transform(X)
894
895 if weight is None:
AttributeError: 'NoneType' object has no attribute 'transform'
The reason for this is that BorutaSHAP does not implement get_params and set_params, so clone(BorutaSHAP()) does not work.
What does this PR do?
for sklearn compatibility. It enabled below.
Problem
cross_val_predict is not supported yet
The reason for this is that BorutaSHAP does not implement get_params and set_params, so clone(BorutaSHAP()) does not work.