Changing the axis of the sample, for example. sample removal, doesnβt (yet?) match the scikit-learn transformer API. Therefore, if you need to do this, you must do this outside of any scikit learn calls, as preprocessing.
As now, the transformer API is used to transform the functions of this sample into something new. It may implicitly contain information from other samples, but samples are never deleted.
Another option is to try to enter the missing values. But then again, if you need to remove samples, treat them as preprocessing before using scikit learn.
source share