asRules.rpart function

Issue #33 new
Paulius Danenas created an issue

In asRules.rpart function, I found, that it might be dependable of specific index:

# Sort rules by probability of second class (usually the last in binary class)
ordered <- rev(sort(frm$yval2[,5], index=TRUE)$ix).

the frame$yvar2 is also a data.frame which seems to contain all the counts of instances for each class by split, as well as their probabilities. Therefore, if I perform classification on a dataset with 10 classes, it would contain 22 variables in total. Furthermore, the later comment in the code at the same file also indicates that:

# The following [,5] is hardwired and works on one example....
 if (rtree)
yval <- frm[i,]$yval

and is also used for probability calculation:

if (! rtree) prob <- frm[i,]$yval2[,5]

So, how is the index 5 selected for calculations? Is it applicable just for specific cases?

Comments (1)

  1. Log in to comment