Struct ppca::PPCAModel

source ·
pub struct PPCAModel(_);
Expand description

A PPCA model which can infer missing values.

Eeach sample for this model behaves according to the following statistical latent variable model.

x ~ N(0; I(nxn))
y = C * x + y0 + noise
noise ~ N(0; sgima ^ 2 * I(mxm))

Here, x is the latent state, y is the observed sample, that is an affine transformation of the hidden state contaminated by isotropic noise.

Note

All arrays involved have to be of data type float64.

Implementations§

Creates a new random untrained model from a given latent state size and a dataset.

Then center of mass of the distribution in the output space.

The standard deviation of the noise in the output space.

The linear transformation from hidden state space to output space.

The number of features for this model.

The number of hidden values for this model.

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

The relative strength of each hidden variable on the output. This is equivalent to the eigenvalues in the standard PCA.

Compute the log-likelihood of a single sample.

Compute the log-likelihood of a given dataset.

Compute the log-likelihood for each sample in a given dataset.

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

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.

Infers the hidden components for one single sample. Use this method for fine-grain control on the properties you want to extract from the model.

Infers the hidden components for each sample in the dataset. Use this method for fine-grain control on the properties you want to extract from the model.

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

Filters each sample of a given datatset, removing noise from the extant samples and inferring the missing samples.

Extrapolates the missing values with the most probable values for a single sample. This method does not alter the extant values.

Extrapolates the missing values with the most probable values for a full dataset. This method does not alter the extant values.

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

Makes one iteration of the EM algorithm for the PPCA over an observed dataset, using a supplied PPCA prior 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.

Returns a canonical version of this model. This does not alter the log-probablility function nor the quality of the training. All it does is to transform the hidden variables.

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.