> write.csv(submission, file = "D:/Kaggle/1_random_forest_r_submission.csv", row.names=FALSE)
>
> imp <- importance(rf, type=1)
> featureImportance <- data.frame(Feature=row.names(imp), Importance=imp[,1])
> p <- ggplot(imp, aes(x=reorder(Feature,Importance), y=Importance) )
错误: ggplot2 doesn't know how to deal with data of class matrix
> +
+ geom_bar() +
+ coord_flip() +
+ theme_light(base_size=20) +
+ xlab("") +
+ ylab("Importance")
错误于+geom_bar() : 一进列运算符的参数不对
> ggtitle("Random Forest Feature Importance\n") +
+ theme(plot.title=element_text(size=18))
错误: 没有"ggtitle"这个函数
>
> ggsave("2_feature_importance.png", p)
运行的 Kagg'le里的一个R语言的例子 我明明featureImportance是data.frame 类型 数据 为什么会出现错误: ggplot2 doesn't know how to deal with data of class matrix