Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Apply the Estimator API | Core scikit-learn API Patterns
Mastering scikit-learn API and Workflows

bookChallenge: Apply the Estimator API

Opgave

Swipe to start coding

You are working with the scikit-learn Estimator API, which follows a consistent pattern across models.

Your goal is to apply the Estimator workflow by fitting a model and generating predictions using the standard fit and predict methods.

  1. Create a LogisticRegression estimator with random_state=42.
  2. Fit the estimator using the provided training data:
    • X_train;
    • y_train.
  3. Use the fitted estimator to generate predictions for X_test.
  4. Store the predictions in the variable y_pred.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 4
single

single

Spørg AI

expand

Spørg AI

ChatGPT

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 this in simpler terms?

What are the main benefits or drawbacks?

Can you give me a real-world example?

close

bookChallenge: Apply the Estimator API

Stryg for at vise menuen

Opgave

Swipe to start coding

You are working with the scikit-learn Estimator API, which follows a consistent pattern across models.

Your goal is to apply the Estimator workflow by fitting a model and generating predictions using the standard fit and predict methods.

  1. Create a LogisticRegression estimator with random_state=42.
  2. Fit the estimator using the provided training data:
    • X_train;
    • y_train.
  3. Use the fitted estimator to generate predictions for X_test.
  4. Store the predictions in the variable y_pred.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 4
single

single

some-alt