Enum lace_codebook::ColType
source · 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
Fields
Univariate continuous (Gaussian) data model
Categorical
Fields
§
k: usizeThe number of values this column can take on. For example, if values in the column are binary, k would be 2.
Categorical data up to 256 instances
Count
Fields
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<ColType> for ColType
impl PartialEq<ColType> for ColType
impl StructuralPartialEq for ColType
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.