Documentation |
Cross-validated classification ensemble
ClassificationPartitionedEnsemble is a set of classification ensembles trained on cross-validated folds. Estimate the quality of classification by cross validation using one or more "kfold" methods: kfoldPredict, kfoldLoss, kfoldMargin, kfoldEdge, and kfoldfun.
Every "kfold" method uses models trained on in-fold observations to predict response for out-of-fold observations. For example, suppose you cross validate using five folds. In this case, every training fold contains roughly 4/5 of the data and every test fold contains roughly 1/5 of the data. The first model stored in Trained{1} was trained on X and Y with the first 1/5 excluded, the second model stored in Trained{2} was trained on X and Y with the second 1/5 excluded, and so on. When you call kfoldPredict, it computes predictions for the first 1/5 of the data using the first model, for the second 1/5 of data using the second model, and so on. In short, response for every observation is computed by kfoldPredict using the model trained without this observation.
cvens = crossval(ens) creates a cross-validated ensemble from ens, a classification ensemble. For syntax details, see the crossval method reference page.
cvens = fitensemble(X,Y,method,nlearn,learners,name,value) creates a cross-validated ensemble when name is one of 'CrossVal', 'KFold', 'Holdout', 'Leaveout', or 'CVPartition'. For syntax details, see the fitensemble function reference page.
CategoricalPredictors |
List of categorical predictors. CategoricalPredictors is a numeric vector with indices from 1 to p, where p is the number of columns of X. |
ClassNames |
List of the elements in Y with duplicates removed. ClassNames can be a numeric vector, vector of categorical variables, logical vector, character array, or cell array of strings. ClassNames has the same data type as the data in the argument Y. |
Combiner |
Cell array of combiners across all folds. |
Cost |
Square matrix, where Cost(i,j) is the cost of classifying a point into class j if its true class is i. |
CrossValidatedModel |
Name of the cross-validated model, a string. |
Kfold |
Number of folds used in a cross-validated ensemble, a positive integer. |
ModelParameters |
Object holding parameters of cvens. |
NumObservations |
Number of data points used in training the ensemble, a positive integer. |
NTrainedPerFold |
Number of data points used in training each fold of the ensemble, a positive integer. |
Partition |
Partition of class cvpartition used in creating the cross-validated ensemble. |
PredictorNames |
Cell array of names for the predictor variables, in the order in which they appear in X. |
Prior |
Prior probabilities for each class. Prior is a numeric vector whose entries relate to the corresponding ClassNames property. |
ResponseName |
Name of the response variable Y, a string. |
ScoreTransform |
Function handle for transforming scores, or string representing a built-in transformation function. 'none' means no transformation; equivalently, 'none' means @(x)x. For a list of built-in transformation functions and the syntax of custom transformation functions, see fitctree. Add or change a ScoreTransform function using dot notation: ens.ScoreTransform = 'function' or ens.ScoreTransform = @function |
Trainable |
Cell array of ensembles trained on cross-validation folds. Every ensemble is full, meaning it contains its training data and weights. |
Trained |
Cell array of compact ensembles trained on cross-validation folds. |
W |
Scaled weights, a vector with length n, the number of rows in X. |
X |
A matrix of predictor values. Each column of X represents one variable, and each row represents one observation. |
Y |
A numeric column vector with the same number of rows as X. Each entry in Y is the response to the data in the corresponding row of X. |
kfoldEdge | Classification edge for observations not used for training |
kfoldLoss | Classification loss for observations not used for training |
resume | Resume training learners on cross-validation folds |
kfoldEdge | Classification edge for observations not used for training |
kfoldfun | Cross validate function |
kfoldLoss | Classification loss for observations not used for training |
kfoldMargin | Classification margins for observations not used for training |
kfoldPredict | Predict response for observations not used for training |
Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB^{®} documentation.