1
$\begingroup$

I was wondering what's the best way to preprocess new samples for my ML classifier.

I have a raw data with about 3000 samples. I'm preprocessing it with some LabelEncoders and TargetEncdoders for categorical variables and StandardScalers for numerical values.

What's the best way to preprocess a single sample for prediction, the same way as raw_data was. How to store parameters, calculated by my encoders.

EX. I have categorical variable, which is transformed with LabelEncoder and than TargetEncoder, and category "A" is transformed to value 0.5 . I want to make sure my single sample, with category "A" will be transofrmed to the same numerical value.

Is it possible to do with Sklearn's pipelines?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.