pub struct CatWtdTable { /* private fields */ }Expand description
A multivariate categorical weighted dataset.
Implementations§
Source§impl CatWtdTable
impl CatWtdTable
Sourcepub fn new(dataset: CatTable, weights: Array1<f64>) -> Self
pub fn new(dataset: CatTable, weights: Array1<f64>) -> Self
Creates a new categorical weighted dataset.
§Arguments
dataset- The categorical dataset.weights- The weights of the samples.
§Panics
- Panics if the number of weights is not equal to the number of samples.
- Panics if any weight is not in the range [0, 1].
§Returns
A new categorical weighted dataset instance.
Sourcepub const fn states(&self) -> &States
pub const fn states(&self) -> &States
Returns the states of the variables in the categorical distribution.
§Returns
A reference to the vector of states.
Trait Implementations§
Source§impl Clone for CatWtdTable
impl Clone for CatWtdTable
Source§fn clone(&self) -> CatWtdTable
fn clone(&self) -> CatWtdTable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Dataset for CatWtdTable
impl Dataset for CatWtdTable
Source§impl Debug for CatWtdTable
impl Debug for CatWtdTable
Source§impl Labelled for CatWtdTable
impl Labelled for CatWtdTable
Source§fn label_to_index(&self, x: &str) -> usize
fn label_to_index(&self, x: &str) -> usize
Return the variable index for a given label. Read more
Source§fn index_to_label(&self, x: usize) -> &str
fn index_to_label(&self, x: usize) -> &str
Return the label for a given variable index. Read more
Source§fn index_to(&self, x: usize, other: &Labels) -> usize
fn index_to(&self, x: usize, other: &Labels) -> usize
Maps an index from this model to another model with the same label. Read more
Source§fn indices_to(&self, x: &Set<usize>, other: &Labels) -> Set<usize>
fn indices_to(&self, x: &Set<usize>, other: &Labels) -> Set<usize>
Maps a set of indices from this model to another model with the same labels. Read more
Auto Trait Implementations§
impl Freeze for CatWtdTable
impl RefUnwindSafe for CatWtdTable
impl Send for CatWtdTable
impl Sync for CatWtdTable
impl Unpin for CatWtdTable
impl UnwindSafe for CatWtdTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more