I have a sklearn pipeline that has a step which fractionally differentiates the features to ensure stationarity. If a feature needs to be made stationary - its length is reduced by 1. If it does not require fractional differentiation, its length remains the same (I think).
from fracdiff.sklearn import Fracdiff
...
self.clf = Pipeline(
steps=[("preprocessor", self.preprocessor),
("simple_imputer", simple_imputer),
("fracdiff", Fracdiff()),
("classifier", model)])
When I apply this pipeline step it results in:
ValueError: Found input variables with inconsistent numbers of samples: [1665, 1666]
I think a reasonable solution would be to standardize the input variable lengths after the fracdiff step to be = min_length of any one feature in X.
My questions:
- Is this a reasonable assumption / approach?
- Can you advise on how I would go about doing this in a sklearn pipeline step/transformation?