How To Use Cross-validation With Custom Estimator In Sklearn?
I have written a custom estimator class with a fit and transform method. I am able to create a model, train and predict using the model. However, while doing cross-validation, I ru
Solution 1:
I would suggest having the preprocessor inside the pipeline itself. Cross_val_score
would try to copy the params of the estimator, it would break when the estimator cannot return the params while calling get_params()
.
I am not sure whether your pipeline parameter is a Sklearn pipeline because the pipeline object is not iterable.
Post a Comment for "How To Use Cross-validation With Custom Estimator In Sklearn?"