pub enum ColType {
Continuous {
hyper: Option<NixHyper>,
prior: Option<NormalInvChiSquared>,
},
Categorical {
k: usize,
hyper: Option<CsdHyper>,
value_map: ValueMap,
prior: Option<SymmetricDirichlet>,
},
Count {
hyper: Option<PgHyper>,
prior: Option<Gamma>,
},
}
Expand description
Stores metadata for the specific column types
Variants§
Continuous
Univariate continuous (Gaussian) data model
Fields
prior: Option<NormalInvChiSquared>
The normal inverse chi-squared prior on components in this column. If set, the hyper prior will be ignored and the prior parameters will not be updated during inference.
Categorical
Categorical data up to 256 instances
Fields
k: usize
The number of values this column can take on. For example, if values in the column are binary, k would be 2.
value_map: ValueMap
Store the category type and a map from usize index to category (and the reverse).
prior: Option<SymmetricDirichlet>
The normal gamma prior on components in this column. If set, the hyper prior will be ignored and the prior parameters will not be updated during inference.
Count
Discrete count-type data in [0, ∞)
Implementations§
Source§impl ColType
impl ColType
pub fn is_continuous(&self) -> bool
pub fn is_categorical(&self) -> bool
pub fn is_count(&self) -> bool
Sourcepub fn value_map(&self) -> Option<&ValueMap>
pub fn value_map(&self) -> Option<&ValueMap>
Return the value map if the type is categorical and a value map exists.
Sourcepub fn ignore_hyper(&self) -> bool
pub fn ignore_hyper(&self) -> bool
Return true if the prior is set, in which case the hyper prior should be ignored, and the prior parameters should not be updated.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ColType
impl<'de> Deserialize<'de> for ColType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ColType
impl Serialize for ColType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ColType
Auto Trait Implementations§
impl !Freeze for ColType
impl RefUnwindSafe for ColType
impl Send for ColType
impl Sync for ColType
impl Unpin for ColType
impl UnwindSafe for ColType
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.