CompactClassificationNeuralNetwork
A CompactClassificationNeuralNetwork
object is a compact version of a
discriminant analysis model, CompactClassificationNeuralNetwork
.
The CompactClassificationDiscriminant
does not include the training
data resulting to a smaller classifier size, which can be used for making
predictions from new data, but not for tasks such as cross validation. It
can only be created from a ClassificationNeuralNetwork
model by using
the compact
object method.
The available methods for a CompactClassificationNeuralNetwork
object
are:
predict
savemodel
See also: fitcdiscr, ClassificationDiscriminant
Source Code: CompactClassificationNeuralNetwork
predict
Classify new data points into categories using the Neural Network classification object.
labels = predict (obj, XC)
returns the vector of
labels predicted for the corresponding instances in XC, using the
trained neural network classification compact model in obj.
CompactClassificationNeuralNetwork
class
object.
[labels, scores] = predict (obj, XC
also
returns scores, which represent the probability of each label
belonging to a specific class. For each observation in X, the predicted
class label is the one with the highest score among all classes.
Alternatively, scores can contain the posterior probabilities if
the ScoreTransform has been previously set.
See also: fitcnet, ClassificationNeuralNetwork, CompactClassificationNeuralNetwork
savemodel
Save a ClassificationNeuralNetwork object.
savemodel (obj, filename)
saves each property of a
CompactClassificationNeuralNetwork object into an Octave binary file, the
name of which is specified in filename, along with an extra
variable, which defines the type classification object these variables
constitute. Use loadmodel
in order to load a classification object
into Octave’s workspace.
See also: loadmodel, fitcnet, ClassificationNeuralNetwork, cvpartition, ClassificationPartitionedModel
## Create a neural network classifier and its compact version # and compare their size load fisheriris X = meas; Y = species; Mdl = fitcnet (X, Y, 'ClassNames', unique (species)) CMdl = crossval (Mdl) Mdl = ClassificationNeuralNetwork ResponseName: 'Y' ClassNames: {'setosa' 'versicolor' 'virginica'} ScoreTransform: 'none' NumObservations: 150 NumPredictors: 4 LayerSizes: [10] Activations: 'sigmoid' OutputLayerActivation: 'sigmoid' Solver: 'Gradient Descend' CMdl = ClassificationPartitionedModel object with properties: BinEdges: [0x0 double] CategoricalPredictors: [0x0 double] ClassNames: [3x1 cell] Cost: [0x0 double] CrossValidatedModel: ClassificationNeuralNetwork KFold: [1x1 double] ModelParameters: [1x1 struct] NumObservations: [1x1 double] Partition: [1x1 cvpartition] PredictorNames: [1x4 cell] Prior: [0x0 double] ResponseName: Y ScoreTransform: none Standardize: 0 Trained: [10x1 cell] X: [150x4 double] Y: [150x1 cell] |