Challenge: 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.
- Split the dataset
Xandyinto training and test sets usingtrain_test_splitwith:test_size=0.25;random_state=42.
- Create a
LogisticRegressionestimator withmax_iter=1000. - Evaluate the estimator using
cross_val_scorewithcv=3. - Create a
GridSearchCVobject namedgrid_searchwith:- the estimator;
- the parameter grid
param_grid; cv=3.
- Fit
grid_searchon the training data. - Store:
- the mean cross-validation score in
cv_mean_score; - the best parameter dictionary in
best_params.
- the mean cross-validation score in
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 4. Розділ 4
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Чудово!
Completion показник покращився до 5.26
Challenge: 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.
- Split the dataset
Xandyinto training and test sets usingtrain_test_splitwith:test_size=0.25;random_state=42.
- Create a
LogisticRegressionestimator withmax_iter=1000. - Evaluate the estimator using
cross_val_scorewithcv=3. - Create a
GridSearchCVobject namedgrid_searchwith:- the estimator;
- the parameter grid
param_grid; cv=3.
- Fit
grid_searchon the training data. - Store:
- the mean cross-validation score in
cv_mean_score; - the best parameter dictionary in
best_params.
- the mean cross-validation score in
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 4. Розділ 4
single