How does predict work for classification tree algorithm?

조회 수: 2 (최근 30일)
Hadas Lapid
Hadas Lapid 2013년 11월 14일
답변: Hadas Lapid 2013년 11월 17일
Following classification with ClassificationTree.fit I get an object obj which contains all model parameters. Then when using predict(data,model) I try it on new data. Question is that I need to translate the predict code into human language, in order to transform it into c code. The code does Not support predict. Can anyone direct me to the full algorithm predict performs? (I couldn't figure it out from predict.m directly..) Many many thanks Hadas

채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 11월 14일
편집: Shashank Prasanna 2013년 11월 14일
Type:
>> view(obj)
you can visualize the tree.
predict generates predictions by following the branches of tree until it reaches a leaf node or a missing value. If predict reaches a leaf node, it returns the classification of that node.
This information is also available in the documentation, scroll down to Algorithm section:
Also here is some theory that you may find useful:

추가 답변 (1개)

Hadas Lapid
Hadas Lapid 2013년 11월 17일
view(tree) was exactly what I needed, thank you!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by