Struct ppca::PPCAMix

source ·
pub struct PPCAMix(_);
Expand description

A mixture of PPCA models. Each PPCA model is associated with a prior probability expressed in log-scale. This models allows for modelling of data clustering and non-linear learning of data. However, it will use significantly more memory and is not guaranteed to converge to a global maximum.

Notes

  • The list of log-weights does not need to be normalized. Normalization is carried out internally.
  • Each PPCA model in the mixture might have its own state size. However, all PPCA models must have the same output space. Additionally, the set of PPCA models must be non-empty.

Implementations§

Creates a new random untrained model from a given number of PPCA modes, a latent state size, a dataset and a smoothing factor. The smoothing factor helps with overfit of rarely occuring dimensions. If you don’t care about that, set it to 0.0.

The number of features for this model.

The number of hidden values for each PPCA model.

The total number of parameters involved in training (used for information criteria).

The list of constituent PPCA models.

The log-strength (or log-a priori probablilty) for each PPCA model.

The strength (or a priori probablilty) for each PPCA model.

Sample a full dataset from the PPCA model and masks each entry according to a Bernoulli (coin-toss) distribution of proability mask_prob of erasing the generated value.

Computes the log-likelihood for a single sample.

Computes the log-likelihood for each sample in a dataset.

Computes the total log-likelihood for a given dataset.

Returns the posterior distribution (i.e., with Baye’s rule applied) for each sample in the given dataset. Each row of the matrix corresponds to a categorical distribution on the probability of a sample belonging to a particular PPCA model.

Infers the probability distribution of a single sample.

Infers the probability distribution of a given dataset.

Filters a single samples, removing noise from it and inferring the missing dimensions.

Filters a dataset of samples, removing noise from the extant samples and inferring the missing samples.

Extrapolates the missing values from a sample with the most probable values.

Extrapolates the missing values from a dataset with the most probable values.

Makes one iteration of the EM algorithm for the PPCA mixture model over an observed dataset, returning a improved model. The log-likelihood will always increase for the returned model.

Makes one iteration of the EM algorithm for the PPCA mixture over an observe dataset, using a supplied PPCA prior (same for all constituent PPCA models) and returning the improved model. This method will not necessarily increase the log-likelihood of the returned model, but it will return an improved maximum a posteriori (MAP) estimate of the PPCA model according to the supplied prior.

Maps PPCAModel::to_canonical for each constituent model.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
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 alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.