Random Forests in Python

http://www.cnblogs.com/downtjs/archive/2013/08/28/3288203.html


http://blog.yhat.com/posts/random-forests-in-python.html


参考了第一个链接,第二个链接是原文。


原文中,随机森林的代码里,由于pandas的更新,Factor这个函数不再使用。第九行“df['species']= pd.Factor(iris.target, iris.target_names)”应改为“df['species'] = pd.Categorical.from_codes(iris.target, iris.target_names)”。


还有一个地方没有弄明白,第16行“

y, _ = pd.factorize(train['species'])
”,等号左侧为什么不是y。



2017/11/30更新。

评价rf模型的方法还有KS曲线。

一些感悟:

1. KS的值在哪个分段,意味着这个分段适合用作threshold

2. KS的值越大越好吧?

predict_proba(X)给出带概率值的结果,用于算ks值



http://blog.csdn.net/liz_zhong/article/details/50005911

这个链接里有python中rf方法的parameter和attribute


关于random forest的调参:

http://blog.csdn.net/sun_shengyun/article/details/54618121


你可能感兴趣的:(Random Forests in Python)