The last part should be part of tranform and fit_transform and given that you can apply a threshold this might not be true.