Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Model Selection Workflow | Model Selection and Evaluation Utilities
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Mastering scikit-learn API and Workflows

bookChallenge: Model Selection Workflow

Compito

Swipe to start coding

You are working with scikit-learn model selection tools to evaluate and compare models in a consistent way.

  1. Split the dataset X and y into training and test sets using train_test_split with:
    • test_size=0.25;
    • random_state=42.
  2. Create a LogisticRegression estimator with max_iter=1000.
  3. Evaluate the estimator using cross_val_score with cv=3.
  4. Create a GridSearchCV object named grid_search with:
    • the estimator;
    • the parameter grid param_grid;
    • cv=3.
  5. Fit grid_search on the training data.
  6. Store:
    • the mean cross-validation score in cv_mean_score;
    • the best parameter dictionary in best_params.

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 4
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

close

bookChallenge: Model Selection Workflow

Scorri per mostrare il menu

Compito

Swipe to start coding

You are working with scikit-learn model selection tools to evaluate and compare models in a consistent way.

  1. Split the dataset X and y into training and test sets using train_test_split with:
    • test_size=0.25;
    • random_state=42.
  2. Create a LogisticRegression estimator with max_iter=1000.
  3. Evaluate the estimator using cross_val_score with cv=3.
  4. Create a GridSearchCV object named grid_search with:
    • the estimator;
    • the parameter grid param_grid;
    • cv=3.
  5. Fit grid_search on the training data.
  6. Store:
    • the mean cross-validation score in cv_mean_score;
    • the best parameter dictionary in best_params.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 4
single

single

some-alt