一.ensemble
1.简介:
该模块用于"集成学习"(ensemble learning)
2.分类:
"自适应提升分类器"(AdaBoost classifier):class sklearn.ensemble.AdaBoostClassifier([base_estimator=None,n_estimators=50,learning_rate=1.0,algorithm='SAMME.R',random_state=None])
#参数说明:
base_estimator:指定基本估计器;为object
n_estimators:指定提升中使用的最大估计器数;为int
learning_rate:指定学习率;为float
#在n_estimators和learning_rate间存在1个权衡
algorithm:指定使用的提升算法;为"SAMME"/"SAMME.R"
random_state:指定使用的随机数;为int/RandomState instance/None
######################################################################################################################
"装袋分类器"(Bagging classifier)/"自举汇聚分类器"(Bootstrap aggregating classifier):class sklearn.ensemble.BaggingClassifier([base_estimator=None,n_estimators=10,max_samples=1.0,max_features=1.0,bootstrap=True,bootstrap_features=False,oob_score=False,warm_start=False,n_jobs=None,random_state=None,verbose=0])
#参数说明:其他参数同class sklearn.ensemble.AdaBoostClassifier()
max_samples,max_features:分别指定用于训练每个基本估计器的样本/特征数;均为int/float
bootstrap,bootstrap_features:分别指定是否通过替换来提取样本/特征;均为bool
oob_score:指定是否使用"包外样本"(out-of-bag samples)来估计泛化误差;为bool
warm_start:指定是否启用热启动;为bool
n_jobs:指定用于并行计算的任务数;为int
verbose:指定输出信息的冗余度;为int/bool
######################################################################################################################
"极端随机树分类器"(Extremely Randomized Trees classifier/ExtRa-trees classifier):class sklearn.ensemble.ExtraTreesClassifier([n_estimators=100,criterion='gini',max_depth=None,min_samples_split=2,min_samples_leaf=1,min_weight_fraction_leaf=0.0,max_features='auto',max_leaf_nodes=None,min_impurity_decrease=0.0,min_impurity_split=None,bootstrap=False,oob_score=False,n_jobs=None,random_state=None,verbose=0,warm_start=False,class_weight=None,ccp_alpha=0.0,max_samples=None])
#参数说明:其他参数同class sklearn.ensemble.BaggingClassifier()
criterion:指定用于衡量拆分质量的标准;为"gini"/"entropy"
max_depth:指定树的最大深度;为int
min_samples_split:指定拆分内部节点所需的最小样本数;为int
#若属于某内部节点的样本少于该值,则停止拆分
min_samples_leaf:指定叶节点中的最小样本数;为int
#若属于某叶节点的样本少于该值,则不进行该拆分
min_weight_fraction_leaf:The minimum weighted fraction of the sum total of weights (of all the input samples) required to be at a leaf node;为float
max_features:指定使用的最大特征数;为"auto"/"sqrt"/"log2"/int/float
max_leaf_nodes:指定最大叶节点数;为int
min_impurity_decrease:指定继续拆分所需的最小改进;为float
#若改进小于该值,则停止拆分
min_impurity_split:指定继续拆分所需的最小损失;为float
#若当前节点的损失小于该值,则停止拆分
class_weight:指定各个特征的权重;为dict/