class sklearn.ensemble.RandomForestClassifier(n_estimators=10(超参数), criterion=’gini’,
max_depth=None(超参数), bootstrap=True, random_state=None)
随机森林分类器
n_estimators:integer,optional(default = 10) 森林里的树木数量
业务常用:120,200,300,500,800,1200
criteria:string,可选(default =“gini”)分割特征的测量方法
max_depth:integer或None,可选(默认=无)树的最大深度
5, 8 15, 25, 30
bootstrap:boolean,optional(default = True)是否在构建树时使用放回抽样
max_features=“auto”, 每个决策树的最大特征数量
if “auto”, then ‘max_featuressqrt(n_features)’.
if “sqrt”, then 'max_featuressqrt(n_features)’.
if “log2”, then ’ max_featureslog2(n_features)’.
if None, then 'max_featuresn_features.
优点:
在当前所有算法中,具有极好的准确率
能够有效地运行在大数据集上
能够处理具有高维特征的输入样本,而且不需要降维
能够评估各个特征在分类问题上的重要性
对于缺省值问题也能够获得很好得结果
N个样本, M个特征
N个样本中选一个建立一个树,重复N次,因此有重复的。
M个特征中选m个特征,因而要对m限制。
随机放回抽样bootstrap