R package for Weighted Random Forest? classwt option? -


i'm trying use random forest predict outcome of extremely imbalanced data set (the 1's rate 1% or less). because traditinal randomforest minimize overall error rate, rather paying special attention positive class, makes traditional randomforest not applicable imbalanced data. want assigne high cost misclassification of minority class(cost sensitive learning).

i read several sources can use option classwt of randomforest on r, don't know how use this. , have other alternatives randomforest funtion?

classwt gives ability assign prior probability each of classes in dataset. so, if have classwt = c(0.5, 0.5), saying before running model specific dataset, expect there around same number of 0's 1's. can adjust these parameters try minimize false negatives. may seem smart idea assign cost in theory, in reality, not work well. prior probabilities tend affect algorithm more sharply desired. still, play around this.

an alternative solution run regular random forest, , prediction, use type='prob' option in predict() command. instance, random forest rf1, trying predict results of dataset data1, do:

predictions <- predict(rf1, data=data1, type='prob') 

then, can choose own probability threshold classifying observations of data. nice way graphically view threshold may desirable use rocr package, generates receiver operator curve.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -