zoukankan      html  css  js  c++  java
  • sklearn之集成算法模型

    一. RandomForest

    1.调用

    1 sklearn.ensemble.RandomForestClassifier(n_estimators=’warn’, criterion=’gini’, max_depth=None, 
    2   min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0, max_features=’auto’, 
    3   max_leaf_nodes=None, min_impurity_decrease=0.0, min_impurity_split=None, bootstrap=True, 
    4   oob_score=False, n_jobs=None, random_state=None, verbose=0, warm_start=False, class_weight=None)


    2. RandomForest参数:

      • n_estimators: 弱学习器的最大迭代次数,默认是100
      • oob_score : 即是否采用袋外样本来评估模型的好坏。默认识False。个人推荐设置为True,因为袋外分数反应了一个模型拟合后的泛化能力
      • criterion: CART树做划分时对特征的评价标准,默认是基尼系数gini
      • max_features: RF划分时考虑的最大特征数,默认是"auto",还有"log2","sqrt",整数,浮点数
      • max_depth: 决策树最大深度
      • min_samples_split: 内部节点再划分所需最小样本数
      • min_samples_leaf: 叶子节点最少样本数
      • min_weight_fraction_leaf: 叶子节点最小的样本权重和
      • max_leaf_nodes: 最大叶子节点数
      • min_impurity_split: 节点划分最小不纯度

    上面参数中最重要的有:n_estimators,max_features,max_depth,min_samples_split,min_samples_leaf

    二. XGBoost

  • 相关阅读:
    996工作制是奋斗还是剥削?
    动态链接的PLT与GOT
    The Product-Minded Software Engineer
    缓冲区溢出
    golang的加法比C快?
    C errno是否是线程安全的
    golang 三个点的用法
    GDB 单步调试汇编
    为什么CPU需要时钟这种概念?
    fliebeat配置手册
  • 原文地址:https://www.cnblogs.com/Alexisbusyblog/p/12403616.html
Copyright © 2011-2022 走看看