Struct ppca::Dataset

source ·
pub struct Dataset {
    pub data: Arc<Vec<MaskedSample>>,
    pub weights: Vec<f64>,
}
Expand description

Represents a dataset. This is a wrapper over a 2D array of dimensions (n_samples, n_features).

Note

All arrays involved have to be of data type float64.

Fields§

§data: Arc<Vec<MaskedSample>>

The data rows of this dataset.

§weights: Vec<f64>

The weights associated with each sample. Use this only if you are using the PPCA as a component of a greater EM scheme (or otherwise know what you are doing). Else, let the package set it automatically to 1.

Implementations§

Creates a new dataset from a set of masked samples.

Creates a new dataset from a set of weighted masked samples.

Creates a new dataset with the same sample, but with different weights. This operation is cheap, since it does not clone the dataset (it’s protected by an Arc).

The lenght of this dataset.

Whether this dataset is empty.

The number of dimensions in each sample. Returns None if dataset is empty.

Lists the dimensions which as masked in all samples in this dataset.

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
Converts to this type from the input type.
Creates a value from an iterator. Read more
Creates a value from an iterator. Read more
Creates an instance of the collection from the parallel iterator par_iter. Read more
Creates an instance of the collection from the parallel iterator par_iter. 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.