ÎncepețiÎncepe gratuit

Prevenirea arborilor supradimensionați

Arborele construit pe întregul set de date ale solicitanților a crescut foarte mult și a devenit extrem de complex, cu sute de ramificații și noduri finale care conțineau doar câțiva solicitanți. Un astfel de arbore ar fi aproape imposibil de interpretat de către un ofițer de credite.

Using the pre-pruning methods for early stopping, you can prevent a tree from growing too large and complex. See how the rpart control options for maximum tree depth and minimum split count impact the resulting tree.

The loans_train and loans_test datasets have been created, and rpart has been pre-loaded.

Acest exercițiu face parte din cursul

Supervised Learning în R: Clasificare

Vezi cursul

Exercițiu interactiv practic

Încearcă acest exercițiu completând acest cod de exemplu.

# Grow a tree with maxdepth of 6
loan_model <- ___

# Make a class prediction on the test set
loans_test$pred <- ___

# Compute the accuracy of the simpler tree
mean(___)
Editează și rulează codul