Sektion 1. Kapitel 4
single
Challenge: Build a Baseline Pipeline
Stryg for at vise menuen
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 4
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat