medium10 pts · first answer countsmachine-learningscikit-learnpipelines
Preprocessing inside a pipeline
What is the main advantage of wrapping preprocessing and the model in one scikit-learn Pipeline like this?
pre = ColumnTransformer([
('num', StandardScaler(), ['age', 'income']),
('cat', OneHotEncoder(handle_unknown='ignore'), ['city']),
])
pipe = Pipeline([('pre', pre), ('clf', LogisticRegression())])
cross_val_score(pipe, X, y, cv=5)Discussion 0
Join free to post in the discussion.
Related questions
- Predicting a flat price in rupeesMachine Learning Engineer
- One gradient descent stepMachine Learning Engineer
- Sigmoid at zeroMachine Learning Engineer
- Logistic regression with five classesMachine Learning Engineer
- The naive part of Naive BayesMachine Learning Engineer
- Entropy of a 50/50 nodeMachine Learning Engineer
- Tree with no depth limitMachine Learning Engineer
- Prediction after one boosting roundMachine Learning Engineer