Docsity

Cart - Minning Data - Lecture Slides, Slides of Computer Fundamentals

Partial preview of the text

Download Cart - Minning Data - Lecture Slides and more Slides Computer Fundamentals in PDF only on Docsity!

Machine Learning

in Real World:

Cart

Outline

  • CART Overview and Gymtutor Tutorial

Example

  • Splitting Criteria
  • Handling Missing Values
  • Pruning
    • Finding Optimal Tree 2

CART Tutorial Data: Gymtutor

CART HELP, Sec 3 in CARTManual.pdf

  • ANYRAQT Racquet ball usage (binary indicator coded 0, 1)
  • ONAER Number of on-peak aerobics classes attended
  • NSUPPS Number of supplements purchased
  • OFFAER Number of off-peak aerobics classes attended
  • NFAMMEM Number of family members
  • TANNING Number of visits to tanning salon
  • ANYPOOL Pool usage (binary indicator coded 0, 1)
  • SMALLBUS Small business discount (binary indicator coded 0, 1)
  • FIT Fitness score
  • HOME Home ownership (binary indicator coded 0, 1)
  • PERSTRN Personal trainer (binary indicator coded 0, 1)
  • CLASSES Number of classes taken.
  • SEGMENT Member’s market segment (1, 2, 3) – target 4

View data

  • CART Menu: View -> Data Info … 5

CART Model Setup

  • Target -- required
  • Predictors (default – all)
  • Categorical
    • ANYRAQT, ANYPOOL, SMALLBUS, HOME
    • Categorical: if field name ends in “$”, or from

values

  • Testing
    • default – 10-fold cross-validation
  • … 7

Sample Tree

8

Decision Tree: Splitters

10

Tree Details

11

Pruning the tree

13

Keeping only important variables

14

Automating CART: Command Log 16

Key CART features

  • Automated field selection
    • handles any number of fields
      • automatically selects relevant fields
  • No data preprocessing needed
    • Does not require any kind of variable transforms
    • Impervious to outliers
  • Missing value tolerant
    • Moderate loss of accuracy due to missing values

CART is a form of Binary Recursive

Partitioning

  • Data is split into two partitions
    • Q: Does C4.5 always have binary partitions?
  • Partitions can also be split into sub-partitions
    • hence procedure is recursive
  • CART tree is generated by repeated partitioning of data set - parent gets two children - each child produces two grandchildren - four grandchildren produce 8 great grandchildren

Splits always determined by questions with YES/NO answers

  • Is continuous variable X ≤ c?
  • Does categorical variable D take on levels i, j, or k?
    • is GENDER M or F?
  • Standard split:
    • if answer to question is YES a case goes left; otherwise it goes right
    • this is the form of all primary splits
    • example : Is AGE ≤ 62.5?
  • More complex conditions possible:
    • Boolean combinations: AGE<=62 OR BP<=
    • Linear combinations: .66AGE - .75BP< -