开发者

How to use R Random forests to reduce attributes having no discrete classes?

开发者 https://www.devze.com 2023-01-06 19:54 出处:网络
I want to use Random forests for attribute reduction. One problem I have in my data is that I don\'t have discrete class - only continuous, which indicates 开发者_运维知识库how example differs from \'

I want to use Random forests for attribute reduction. One problem I have in my data is that I don't have discrete class - only continuous, which indicates 开发者_运维知识库how example differs from 'normal'. This class attribute is a kind of distance from zero to infinity. Is there any way to use Random forest for such data?


That should be no problem -- RF will just switch to regression mode. Use randomForest function from the randomForest package.
To get object similarity with proximity=TRUE argument, like:

randomForest(Sepal.Length~.,data=iris,proximity=TRUE)$proximity

To get node-purity (Gini-index like) attribute importance:

randomForest(Sepal.Length~.,data=iris)$importance[,"IncNodePurity"]

To get mean MSE increase (accuracy-decrease like) attribute importance:

randomForest(Sepal.Length~.,data=iris,importance=TRUE)$importance[,"%IncMSE"]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号