ランダムフォレスト雑感

最近はGBMばっかりでランダムフォレストは噛ませ犬的にしか使わないんだけどたまに話題に出るのでまとめておく。

Alternating Decision Forests

下記ランダムフォレストの資料の中で触れられているAlternating Decision Forestsが気になった。
http://www.habe-lab.org/habe/RFtutorial/SSII2013_RFtutorial_Slides.pdf
Revolution analyticsのブログでも昨年の時点で触れられていた。
http://blog.revolutionanalytics.com/2013/11/counting-the-dead.html
Rには実装がないがWekaにはあるのでそれをRWekaを使って叩くコードは下記にある。
http://datamining.togaware.com/survivor/Alternating_Decision.html
試してないのでひょっとしたら動かないかもしれない。

ランダムフォレストのvariable importanceについて

説明モデルとしてランダムフォレストを使う場合、variable importanceの算出がどのように実装されているかについては注意しておく必要がある。
代表的なimportance算出法はGini importanceとPermutation importanceだがそれぞれ問題があるようで。
引用は全て2009年に出た下記文献より。
http://journal.r-project.org/archive/2009-2/RJournal_2009-2_Strobl~et~al.pdf
まずGiniについて。

the Gini importance has been shown to carry forward the bias of the underlying Gini-gain splitting criterion (see, e.g., Kim and Loh, 2001; Strobl et al., 2007a; Hothorn et al., 2006) when predictor variables vary in their number of categories or scale of measurement (Strobl et al., 2007b). Therefore, it is not recommended in these situations.

また、Permutationを使う場合についても。

The original permutation-importance measure can,for reasons outlined below, be considered as a marginal measure of importance. In this sense, it has the same property as, e.g., a marginal correlation co-
efficient: A variable that has no effect of its own, but is correlated with a relevant predictor variable, can receive a high importance score.

上記文献で紹介されているPartyパッケージのcForestはこの点をconditional importance measureで解決している。どう解決しているかは文献中の図を見ればなんとなくわかるんじゃないかなああああ。
Partyパッケージはこちら。
http://cran.r-project.org/web/packages/party/index.html
enjoy!