Sección 1. Capítulo 4
single
Challenge: Build a Baseline Pipeline
Desliza para mostrar el menú
Tarea
Swipe to start coding
You need to create a machine learning pipeline that standardizes input features and fits a classification model.
- Load the Iris dataset.
- Split it into training and test sets.
- Create a pipeline that:
- Uses
StandardScalerto standardize the data; - Uses
RandomForestClassifieras the model.
- Uses
- Fit the pipeline on the training data.
- Predict on the test data.
- Calculate accuracy using
accuracy_scoreand assign it to the variableaccuracy.
Make sure to print the value of accuracy at the end.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 4
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla