Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Model Selection Workflow | Model Selection and Evaluation Utilities
Mastering scikit-learn API and Workflows

bookChallenge: Model Selection Workflow

Завдання

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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 4. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

bookChallenge: Model Selection Workflow

Свайпніть щоб показати меню

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 4. Розділ 4
single

single

some-alt