Challenge: Model Selection Workflow
Tarea
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
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 4. Capítulo 4
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Genial!
Completion tasa mejorada a 5.26
Challenge: Model Selection Workflow
Desliza para mostrar el menú
Tarea
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
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 4. Capítulo 4
single