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

bookChallenge: Apply the Estimator API

Task

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.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Apply the Estimator API

Swipe to show menu

Task

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.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 4
single

single

some-alt