Documentation

ClassificationBaggedEnsemble class

Superclasses:

Classification ensemble grown by resampling

描述

ClassificationBaggedEnsemblecombines a set of trained weak learner models and data on which these learners were trained. It can predict ensemble response for new data by aggregating predictions from its weak learners.

Construction

Create a bagged classification ensemble object usingfitcensemble.

Properties

分类预期

Categorical predictor indices, specified as a vector of positive integers.分类预期包含与包含分类预测变量的预测器数据列相对应的索引值。如果没有任何预测变量是分类的,则此属性为空([])。

ClassNames

元素列表Y删除了重复项。ClassNames可以是数字向量,分类向量,逻辑向量,字符阵列或字符向量的单元格数组。ClassNames与参数中的数据具有相同的数据类型Y.

结合体重

角色向量描述了如何ens结合学习者体重弱“加权”或者'加权平均'.

扩展了predictictOrnames

Expanded predictor names, stored as a cell array of character vectors.

If the model uses encoding for categorical variables, then扩展了predictictOrnamesincludes the names that describe the expanded variables. Otherwise,扩展了predictictOrnames是相同的预测器.

FitInfo

Numeric array of fit information. Thefitinfodescriptionproperty describes the content of this array.

fitinfodescription

角色向量描述了FitInfoarray.

freSample

Numeric scalar between01.freSample是the fraction of training datafitcensemble在构建合奏时,每个弱学习者都随机重新采样。

HyperparameterOptimizationResults

描述的cross-validation optimization of hyperparameters, stored as a贝叶斯式化对象或超参数和相关值的表。当OptimizeHyperparameters名称值对在创建方面是非空的。价值取决于设置高参数量像创建时的名称值对:

  • 'bayesopt'(默认) - 类的对象贝叶斯式化

  • 'gridsearch'或者'randomsearch'— Table of hyperparameters used, observed objective function values (cross-validation loss), and rank of observations from lowest (best) to highest (worst)

Method

Character vector describing the method that createsens.

ModelParameters

Parameters used in trainingens.

NumTrained

Number of trained weak learners inens, a scalar.

预测器

预测变量的单元格数字,按照它们出现的顺序X.

ReasonForTermination

Character vector describing the reasonfitcensemble停止在合奏中添加薄弱的学习者。

Replace

Logical value indicating if the ensemble was trained with replacement (真的) or without replacement (false)。

响应类型

Character vector with the name of the response variableY.

ScoreTransform

用于转换分数的功能句柄或代表内置转换函数的字符向量。'none'意味着不转变;等效,'none'方法@(x)x. For a list of built-in transformation functions and the syntax of custom transformation functions, seefitctree.

Add or change aScoreTransform使用点表示法的函数:

ens.scoretransform ='功能'

或者

ens.scoretransform = @功能

训练有素

受过训练的学习者,紧凑的分类模型的单元格数组。

训练有素Weights

较弱学习者的训练重量的数字向量ens.训练有素WeightshasTelements, whereT是the number of weak learners in学习者.

UseObsForLearner

逻辑矩阵的大小N-经过-NumTrained, 在哪里N是the number of observations in the training data andNumTrained是the number of trained weak learners.UseObsForLearner(I,J)真的if observationIwas used for training learnerJ, 并且是falseotherwise.

W

缩放权重,长度的向量n,排在X. The sum of the elements ofW1.

X

Matrix of predictor values that trained the ensemble. Each column ofXrepresents one variable, and each row represents one observation.

Y

一个分类数组,字符向量的单元格数组,字符阵列,逻辑向量或数字向量与行相同数量的行X. Each row ofYrepresents the classification of the corresponding row ofX.

方法

OOBEDGE Out-of-bag classification edge
oobLoss Out-of-bag classification error
OOBMARGIN Out-of-bag classification margins
oobPermutedPredictorImportance 预测指标通过对分类树的随机森林的排列外预测观测的置换来预测重要性估计
oobPredict Predict out-of-bag response of ensemble

Inherited Methods

袖珍的 紧凑型分类合奏
crossval Cross validate ensemble
resubEdge Classification edge by resubstitution
重新公开 分类错误通过重述
repubmargin 通过重新确定的分类利润率
resubPredict 通过重新结算预测合奏的反应
resume 简历培训合奏
比较 使用新数据比较两个分类模型的精度
边缘 Classification edge
loss 分类错误
margin 分类边缘
预测 Predict labels using ensemble of classification models
预测或者Importance 预测指标的重要性
删除者 Remove members of compact classification ensemble

Copy Semantics

价值。要了解价值类别如何影响复制操作,请参见复制对象(MATLAB)。

例子

全部收缩

加载ionospheredata set.

loadionosphere

Train a bagged ensemble of 100 classification trees using all measurements.

rng(1)%可再现性mdl = fitCensemble(x,y,'Method','包')
Mdl = classreg.learning.classif.ClassificationBaggedEnsemble ResponseName: 'Y' CategoricalPredictors: [] ClassNames: {'b' 'g'} ScoreTransform: 'none' NumObservations: 351 NumTrained: 100 Method: 'Bag' LearnerNames: {'Tree'}理性终止:“在完成所需数量的训练周期后,通常终止。”fitinfo:[] fitinfodescription:'none'freSample:1替换:1 UseObsForlearner:[351x100逻辑]属性,方法,方法

MDL是aClassificationBaggedEnsemblemodel object.

MDL。训练是存储经过训练的分类树的100 x细胞向量的属性(compactClassificationTreemodel objects) that compose the ensemble.

绘制第一个受过训练的分类树的图。

查看(mdl.Trained {1},'Mode','graph')

默认,fitcensemblegrows deep decision trees for bagged ensembles.

估计样本中的错误分类率。

l =重新公开(MDL)
L = 0

L是0,表明MDL非常适合分类培训数据。

提示

对于分类树的包装合奏,训练有素property ofens存储一个细胞向量en.compactClassificationTreemodel objects. For a textual or graphical display of treet在单元向量中,输入

查看(ens.trained {t})

Extended Capabilities

在R2011a中引入

这个话题有帮助吗?