xiaoxiao87
xiaoxiao87

Reputation: 833

Handling case weight in the Random Forest packages in R

I checked both the randomForest and the rfsrc packages in R, but couldn't find an easy way to apply observation/case weight when training the random forest model. Is there any way to do this?

As an alternative I thought about replicating my observations (e.g. replicate once if the observation has a weight of 2), but think this would be inefficient and difficult for non-integer case weight.

Upvotes: 1

Views: 791

Answers (1)

shane
shane

Reputation: 111

You could use the tree package which allows you to weight individual observations. This would of course only give you a single tree, so you would have to make the random forest yourself.

It might be a little more work, but it's probably a better solution than replicating observations.

Upvotes: 1

Related Questions