Challenge: Build a Preprocessing Workflow
Opgave
Swipe to start coding
You are building a basic preprocessing workflow using scikit-learn.
- Use
SimpleImputer(strategy="mean")for numeric columns. - Use
OneHotEncoder(sparse=False)for categorical columns. - Apply both transformations using a
ColumnTransformernamedpreprocessor. - Fit and transform the DataFrame
df. - Store the result in the variable
result.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. 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
Suggested prompts:
Can you explain that in more detail?
What are the main benefits or drawbacks?
Can you give me an example?
Fantastisk!
Completion rate forbedret til 5.26
Challenge: Build a Preprocessing Workflow
Stryg for at vise menuen
Opgave
Swipe to start coding
You are building a basic preprocessing workflow using scikit-learn.
- Use
SimpleImputer(strategy="mean")for numeric columns. - Use
OneHotEncoder(sparse=False)for categorical columns. - Apply both transformations using a
ColumnTransformernamedpreprocessor. - Fit and transform the DataFrame
df. - Store the result in the variable
result.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 4
single