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

bookChallenge: Model Selection Workflow

Tehtävä

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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 4
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: Model Selection Workflow

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 4
single

single

some-alt