1 / 11

R & Trees

Learn about the tree and rpart libraries in R, and understand the Plant Cost-Complexity Measure and Complexity Parameters used in tree models. Discover how to control the fit using rpart.control() and explore Cross-Validation techniques like 10-fold and Bootstrap.

shoemake
Download Presentation

R & Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. R & Trees • There are two tree libraries: • tree: original • rpart: New and used by Plant

  2. Cost-Complexity Measure • Cost-Complexity Measure (cp) • Relative error (rel error) • Related to R2: • R2 = 1 – Relative error • Complexity Measure: • - Number of terminal nodes • – Complexity parameter

  3. R Parameters • Rpart.control() • Creates the parameters to control fit • minsplit – minimum number of data points in a node before a split is tried • cp – complexity parameter • Time to learn to read the R documentation!

  4. If X>50 Value=1 Else Value=2

  5. If (X>50) and (Y>50) Value=2 Else if (X<50) and (Y<50) Value=2 Else Value =1

  6. Cross-Validation • 10 fold • Bootstrap

More Related