美文网首页学习scikit-learn
sklearn.ensemble.RandomForestCla

sklearn.ensemble.RandomForestCla

作者: DayDayUp_hhxx | 来源:发表于2017-06-25 18:10 被阅读174次

    class sklearn.ensemble.RandomForestClassifier(n_estimators=10, 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_split=1e-07, bootstrap=True, oob_score=False, n_jobs=1, random_state=None, verbose=0, warm_start=False, class_weight=None)

    参数

    • n_estimators : integer, optional (default=10)
      随机森林中树的数量;
    • criterion : string, optional (default=”gini”)
      树分裂的规则:gini系数,entropy熵;
    • max_features : int, float, string or None, optional (default=”auto”)
      查找最佳分裂所需考虑的特征数,
      int:分裂的最大特征数,
      float:分裂的特征占比,
      auto、sqrt:sqrt(n_features),
      log2:log2(n_features),
      None:n_features,
    • max_depth : integer or None, optional (default=None)
      树的最大深度;
    • min_samples_split:int, float, optional (default=2)
      最小分裂样本数;
    • min_samples_leaf : int, float, optional (default=1)
      最小叶子节点样本数;
    • min_weight_fraction_leaf : float, optional (default=0.)
      最小叶子节点权重;
    • max_leaf_nodes : int or None, optional (default=None)
      最大叶子节点数;
    • min_impurity_split : float, optional (default=1e-7)
      分裂的最小不纯度;
    • bootstrap : boolean, optional (default=True)
      是否使用bootstrap;
    • oob_score : bool (default=False)
      是否使用袋外(out-of-bag)样本估计准确度;
    • n_jobs : integer, optional (default=1)
      并行job数,-1 代表全部;
    • random_state : int, RandomState instance or None, optional (default=None)
      随机数种子;
    • verbose : int, optional (default=0)
      Controls the verbosity of the tree building process.(控制树冗余?)
    • warm_start : bool, optional (default=False)
      如果设置为True,在之前的模型基础上预测并添加模型,否则,建立一个全新的森林;
    • class_weight : dict, list of dicts, “balanced”,
      “balanced” 模式自动调整权重,每类的权重为 n_samples / (n_classes * np.bincount(y)),即类别数的倒数除以每类样本数的占比。

    属性

    • estimators_ : list of DecisionTreeClassifier
      森林中的树;
    • classes_ : array of shape = [n_classes] or a list of such arrays
      类标签;
    • n_classes_ : int or list
      类;
    • n_features_ : int
      特征数;
    • n_outputs_ : int
      输出数;
    • feature_importances_ : array of shape = [n_features]
      特征重要性;
    • oob_score_ : float
      使用袋外样本估计的准确率;
    • oob_decision_function_ : array of shape = [n_samples, n_classes]
      决策函数

    相关文章

      网友评论

        本文标题:sklearn.ensemble.RandomForestCla

        本文链接:https://www.haomeiwen.com/subject/xmhrcxtx.html