下面给出了我使用的代码,并且还显示了错误 数据位于https://data.gov.in/catalog/historical-daily-ambient-air-quality-data,仅下载2015年的德里数据 click here for sample dataset and to know about it
//Importing the data
> library(readxl)
> aq_delhi_2015 <- read_excel("C:/Users/NAMIT/Desktop/aq_delhi-2015.xlsx")
//View the data
> View(aq_delhi_2015)
//Subsetting the data for the station code=55
> delhi1 <- subset(aq_delhi_2015,aq_delhi_2015$`Stn Code`=="55")
//view the dataset Delhi1
> View(delhi1)
//Importing the necessary packages
> library("RWeka", lib.loc="~/R/win-library/3.5")
> library("party", lib.loc="~/R/win-library/3.5")
//Creating the decision tree
> tree1 <- J48(delhi1$`Stn Code`~.,data = delhi1)
//错误 .jcall(o,“ Ljava / lang / Class;”,“ getClass”)中的错误:weka.core.UnsupportedAttributeTypeException:weka.classifiers.trees.J48:无法处理字符串属性!