Package: classreg.learning.classif
Superclasses: ClassificationEnsemble
Classification ensemble grown by resampling
ClassificationBaggedEnsemble
combines 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.
Create a bagged classification ensemble object using fitcensemble
. Set the name-value pair argument
'Method'
of fitcensemble
to
'Bag'
to use bootstrap aggregation (bagging, for example, random
forest).
|
Bin edges for numeric predictors, specified as a cell array of p numeric vectors, where p is the number of predictors. Each vector includes the bin edges for a numeric predictor. The element in the cell array for a categorical predictor is empty because the software does not bin categorical predictors. The software bins numeric predictors only if you specify the You can reproduce the binned predictor data X = mdl.X; % Predictor data
Xbinned = zeros(size(X));
edges = mdl.BinEdges;
% Find indices of binned predictors.
idxNumeric = find(~cellfun(@isempty,edges));
if iscolumn(idxNumeric)
idxNumeric = idxNumeric';
end
for j = idxNumeric
x = X(:,j);
% Convert x to array if x is a table.
if istable(x)
x = table2array(x);
end
% Group x into bins by using the Xbinned
contains the bin indices, ranging from 1 to the number of bins, for numeric predictors.
Xbinned values are 0 for categorical predictors. If
X contains NaN s, then the corresponding
Xbinned values are NaN s.
|
|
Categorical predictor
indices, specified as a vector of positive integers. |
|
List of the elements in |
|
Character vector describing how |
|
Expanded predictor names, stored as a cell array of character vectors. If the model uses encoding for categorical variables, then
|
|
Numeric array of fit information. The
|
|
Character vector describing the meaning of the |
|
Numeric scalar between |
|
Description of the cross-validation optimization of hyperparameters,
stored as a
|
|
Character vector describing the method that creates
|
|
Parameters used in training |
|
Number of trained weak learners in |
|
Cell array of names for the predictor variables, in the order in which
they appear in |
|
Character vector describing the reason |
|
Logical value indicating if the ensemble was trained with replacement
( |
|
Character vector with the name of the response variable
|
|
Function handle for transforming scores, or character vector representing
a built-in transformation function. Add or change a ens.ScoreTransform = 'function' or ens.ScoreTransform = @function |
|
Trained learners, a cell array of compact classification models. |
|
Numeric vector of trained weights for the weak learners in
|
|
Logical matrix of size
|
|
Scaled |
|
Matrix or table of predictor values that trained the ensemble. Each column
of |
|
A categorical array, cell array of character vectors, character array,
logical vector, or a numeric vector with the same number of rows as
|
compact | Compact classification ensemble |
crossval | Cross validate ensemble |
edge | Classification edge |
loss | Classification error |
margin | Classification margins |
oobEdge | Out-of-bag classification edge |
oobLoss | Out-of-bag classification error |
oobMargin | Out-of-bag classification margins |
oobPermutedPredictorImportance | Predictor importance estimates by permutation of out-of-bag predictor observations for random forest of classification trees |
oobPredict | Predict out-of-bag response of ensemble |
partialDependence | Compute partial dependence |
plotPartialDependence | Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots |
predict | Classify observations using ensemble of classification models |
predictorImportance | Estimates of predictor importance for classification ensemble of decision trees |
removeLearners | Remove members of compact classification ensemble |
resubEdge | Classification edge by resubstitution |
resubLoss | Classification error by resubstitution |
resubMargin | Classification margins by resubstitution |
resubPredict | Classify observations in ensemble of classification models |
resume | Resume training ensemble |
Value. To learn how value classes affect copy operations, see Copying Objects.
For a bagged ensemble of classification trees, the Trained
property of ens
stores a cell vector of
ens.NumTrained
CompactClassificationTree
model objects. For a textual or graphical display
of tree t
in the cell vector,
enter
view(ens.Trained{t})
ClassificationEnsemble
| compareHoldout
| fitcensemble
| fitctree
| view