pub struct EM { /* private fields */ }
Expand description
The class implements the Expectation Maximization algorithm.
[ml_intro_em]
Creates empty %EM model.
The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you
can use one of the EM::train* methods or load it from file using Algorithm::load<EM>(filename).
Loads and creates a serialized EM from a file
Use EM::save to serialize and store an EM to disk.
Load the EM from this file again, by calling this function with the path to the file.
Optionally specify the node for the file containing the classifier
- filepath: path to serialized EM
- nodeName: name of node containing the classifier
Loads and creates a serialized EM from a file
Use EM::save to serialize and store an EM to disk.
Load the EM from this file again, by calling this function with the path to the file.
Optionally specify the node for the file containing the classifier
- filepath: path to serialized EM
- nodeName: name of node containing the classifier
This alternative version of [load] function uses the following default values for its arguments:
Clears the algorithm state
Reads algorithm parameters from a file storage
Stores algorithm parameters in a file storage
Stores algorithm parameters in a file storage
Read more
Deprecated: ## Note
This alternative version of [write_with_name] function uses the following default values for its arguments:
Read more
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
Saves the algorithm to a file.
In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
Returns the algorithm string identifier.
This string is used as top level xml/yml node tag when the object is saved to a file or string.
Return an the underlying raw pointer while consuming this wrapper.
Read more
Return the underlying mutable raw pointer
Read more
Formats the value using the given formatter.
Read more
Executes the destructor for this type.
Read more
The number of mixture components in the Gaussian mixture model.
Default value of the parameter is EM::DEFAULT_NCLUSTERS=5. Some of %EM implementation could
determine the optimal number of mixtures within a specified value range, but that is not the
case in ML yet.
Read more
Constraint on covariance matrices which defines type of matrices.
See EM::Types.
Read more
The termination criteria of the %EM algorithm.
The %EM algorithm can be terminated by the number of iterations termCrit.maxCount (number of
M-steps) or when relative change of likelihood logarithm is less than termCrit.epsilon. Default
maximum number of iterations is EM::DEFAULT_MAX_ITERS=100.
Read more
Estimate the Gaussian mixture parameters from a samples set.
Read more
Estimate the Gaussian mixture parameters from a samples set.
Read more
Estimate the Gaussian mixture parameters from a samples set.
Read more
Estimate the Gaussian mixture parameters from a samples set.
Read more
Estimate the Gaussian mixture parameters from a samples set.
Read more
Estimate the Gaussian mixture parameters from a samples set.
Read more
The number of mixture components in the Gaussian mixture model.
Default value of the parameter is EM::DEFAULT_NCLUSTERS=5. Some of %EM implementation could
determine the optimal number of mixtures within a specified value range, but that is not the
case in ML yet.
Read more
Constraint on covariance matrices which defines type of matrices.
See EM::Types.
Read more
The termination criteria of the %EM algorithm.
The %EM algorithm can be terminated by the number of iterations termCrit.maxCount (number of
M-steps) or when relative change of likelihood logarithm is less than termCrit.epsilon. Default
maximum number of iterations is EM::DEFAULT_MAX_ITERS=100.
Read more
Returns the cluster centers (means of the Gaussian mixture)
Read more
Returns posterior probabilities for the provided samples
Read more
Returns posterior probabilities for the provided samples
Read more
Returns a likelihood logarithm value and an index of the most probable mixture component
for the given sample.
Read more
Converts to this type from the input type.
Converts to this type from the input type.
Returns the number of variables in training samples
Returns true if the model is trained
Returns true if the model is classifier
Computes error on the training or test dataset
Read more
Predicts response(s) for the provided sample(s)
Read more
Predicts response(s) for the provided sample(s)
Read more
The type returned in the event of a conversion error.
Performs the conversion.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.