Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Apply the Estimator API | Core scikit-learn API Patterns
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Mastering scikit-learn API and Workflows

bookChallenge: Apply the Estimator API

Uppgift

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 allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 4
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

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

Svep för att visa menyn

Uppgift

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 desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 4
single

single

some-alt