我在使用 J48 功能时遇到了一些问题。
首先,我创建了训练和测试数据
```{r Training e Test set}
set.seed(123)
sample = sample.split(data$Classification, SplitRatio = .7)
train = subset(data[,], sample==T)
test = subset(data[,], sample==F)```
然后我检查了我感兴趣的变量是否是一个因素
str(train)
它是:$ Classification : Factor w/ 2 levels "High","Low": 2 1 2 2 2 1 1 2 2 1 ...
最终,我做了树
TreeT1 <- J48(Classification~., data= train)
但我得到了这个错误:
Error in .jcall(o, "Ljava/lang/Class;", "getClass")
weka.core.UnsupportedAttributeTypeException: weka.classifiers.trees.J48: Cannot handle string attributes!
此问题是否与已安装的软件包有关?
谢谢!!