Challenge: Model Selection Workflow
Taak
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
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 4. Hoofdstuk 4
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Geweldig!
Completion tarief verbeterd naar 5.26
Challenge: Model Selection Workflow
Veeg om het menu te tonen
Taak
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
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 4. Hoofdstuk 4
single