cart - classification and regression tree

23
CART Classification and Regression Tree PONTIFÍCIA UNIVERSIDADE CATÓLICA DO RIO GRANDE DO SUL FACULDADE DE INFORMÁTICA - FACIN Cleverson Ledur

Upload: cleverson-ledur

Post on 14-Jun-2015

134 views

Category:

Data & Analytics


3 download

DESCRIPTION

Cart - Classification and Regression Tree

TRANSCRIPT

Page 1: Cart - Classification and Regression Tree

CARTClassification and Regression Tree

PONTIFÍCIA UNIVERSIDADE CATÓLICA DO RIO GRANDE DO SULFACULDADE DE INFORMÁTICA - FACIN

Cleverson Ledur

Page 2: Cart - Classification and Regression Tree

CART no Data Mining

✓ Classificação✓ Regressão❏ Descoberta de Regras de Associação❏ Descoberta de Padrões Sequenciais❏ Agrupamento (clustering)❏ Detecção de Anomalias

Page 3: Cart - Classification and Regression Tree

Classificação

É a técnica de aprendizado sobre um conjunto de dados f que mapeia atributos x para alguma classe y já predefinida. (TAM,2006)

Ex: Classificação de animais (temperatura corpo, pele, pelos, pernas, hiberna) = Mammal, reptile, fish, amphibian...

Page 4: Cart - Classification and Regression Tree

Classificação

Page 5: Cart - Classification and Regression Tree

Árvores de Decisão

Page 6: Cart - Classification and Regression Tree

Árvores de Decisão

Page 7: Cart - Classification and Regression Tree

CARTÉ um algoritmo não paramétrico. Possui grande capacidade de pesquisa de relações entre os dados, prevendo o tratamento de variáveis dependentes discretas, através da classificação, ou de variáveis contínuas, pela regressão.

Apresentado por Leo Breiman, Jerome Friedman, Richard Oslen e Charles Stone apud [FON 94], em 1984.

Page 8: Cart - Classification and Regression Tree

CARTÉ um algoritmo não paramétrico. Possui grande capacidade de pesquisa de relações entre os dados, prevendo o tratamento de variáveis dependentes discretas, através da classificação, ou de variáveis contínuas, pela regressão.

Apresentado por Leo Breiman, Jerome Friedman, Richard Oslen e Charles Stone apud [FON 94], em 1984.

não presumem que a estrutura de um modelo é fixa. Tipicamente, o modelo cresce no sentido de acomodar a complexidade dos dados.

Page 9: Cart - Classification and Regression Tree

CART● Indução pela abordagem top-down● Se baseia em um arquivo de treinamento de dados● Constrói uma árvore de decisão

○ Particiona em duas ligações cada nodo.○ Separa os registros de cada partição

● Atributo a ser particionado = gera grupos com a menor diversidade

Page 10: Cart - Classification and Regression Tree

CART é RecursivoO processo é aplicado recursivamente a cada um dos subconjuntos assim gerados, até que não seja possível ou necessário efetuar mais nenhuma partição, sendo cada registro do conjunto de treinamento atribuído a alguma folha da AD.

Page 11: Cart - Classification and Regression Tree

CART

Métodos de classificação e regressão baseados em particões binárias recursivas de uma amostra.

Page 12: Cart - Classification and Regression Tree

CART

● Define o conjunto de regras para dividir cada nó da árvore.

● Decidir quando a árvore está completa. ● Associar cada nó terminal a uma classe ou a

um valor preditivo no caso da regressão.

Page 13: Cart - Classification and Regression Tree

CART

● Calcula as melhores divisões. (Gini)● Uma vez encontrada a melhor divisão,

repete-se o processo de procura para cada nó filho, continuamente até que a divisão seja impossível ou interrompida.

Page 14: Cart - Classification and Regression Tree

CART

● Depois que todos os nós terminais foram encontrados, é definida a árvore como maximal, ou seja, a árvore de tamanho máximo.

Page 15: Cart - Classification and Regression Tree

CART

Após encontrar a árvore maximal, começa-se a podar alguns ramos da mesma árvore de modo a aumentar o poder de generalização.

Algumas sub-árvores, obtidas através da poda de alguns ramos desta árvore, são examinadas testando taxas de erros e a melhor delas é escolhida.

Page 16: Cart - Classification and Regression Tree

AlgoritmoMakeTree(Training Data T)

Partition(T);Partition(Data S)

if (all points in S are in the same class)) then return;evaluate splits for each attribute AUse best split found to partition S into S¹ and S²;Partition(S¹);Partition(S²);

Page 17: Cart - Classification and Regression Tree

CART (Parallel)Parallel Decision Tree Algorithm Based on Combination - Li Wenlong, Xing ChangzhengA Streaming Parallel Decision Tree Algorithm - Yael Ben-Haim, Elad Tom-TovHC-CART: A Parallel System Implementation of Data Mining Classification and Regression Tree Algorithm on a Multi-FPGA System - Grigorios Chrysos, at al.

Page 18: Cart - Classification and Regression Tree

Classification (Parallel)SHAFER,J.,A GRAWAL,R., AND MEHTA, M. 1996. SPRINT: A scalable parallel classifier for data mining. In Proceedings of the 22nd International Conference on Very Large Databases. 544–555

MEHTA,M.,A GRAWAL,R.,AND RISSANEN, J. 1996. SLIQ: A fast scalable classifier for data mining. In Advances in Database Technology. Springer, 18–32

Page 19: Cart - Classification and Regression Tree

Cart using MatlabMPI *

1 - Supomos que o tamanho do dataset é N e o número de processadores é P.2 - O processador Rank-0 -faz a leitura do dataset. -distribui o dataset dividido igualmente entre os processadores

http://www.ll.mit.edu/HPEC/agendas/proc03/pdfs/khot.pdf

Page 20: Cart - Classification and Regression Tree

Cart using MatlabMPI

3 - Os outros processadores -Fazem o cálculo de todos os

atributos -Enviam os resultados

4 - Rank-0 -Recebe os cálculos -Escolhe a melhor divisão

Page 21: Cart - Classification and Regression Tree

Cart using MatlabMPI

5 - Rank-0 -Se todos os nodos pertencerem a

mesma classe, encerra o processamento. -Se não, envia a melhor divisão para

todos os processadores

Page 22: Cart - Classification and Regression Tree

Cart using MatlabMPI

6 - Outros processadores -Dividem os dados entre direita e

esquerda com o melhor atributo

Etapas 3-6 são repedidas.

Page 23: Cart - Classification and Regression Tree