Skip to main content

entrenar/config/infer/
types.rs

1//! Feature type enumeration for auto-inference
2
3/// Inferred feature type
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub enum FeatureType {
6    /// Continuous numeric values (float32/float64)
7    Numeric,
8    /// Discrete categories with limited cardinality
9    Categorical,
10    /// Free-form text requiring tokenization
11    Text,
12    /// Timestamp/datetime values
13    DateTime,
14    /// Pre-computed embedding vectors
15    Embedding,
16    /// Binary classification target
17    BinaryTarget,
18    /// Multi-class classification target
19    MultiClassTarget,
20    /// Regression target
21    RegressionTarget,
22    /// Sequence of tokens (for language models)
23    TokenSequence,
24    /// Unknown/ambiguous type
25    Unknown,
26}
27
28impl std::fmt::Display for FeatureType {
29    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30        match self {
31            Self::Numeric => write!(f, "numeric"),
32            Self::Categorical => write!(f, "categorical"),
33            Self::Text => write!(f, "text"),
34            Self::DateTime => write!(f, "datetime"),
35            Self::Embedding => write!(f, "embedding"),
36            Self::BinaryTarget => write!(f, "binary_target"),
37            Self::MultiClassTarget => write!(f, "multiclass_target"),
38            Self::RegressionTarget => write!(f, "regression_target"),
39            Self::TokenSequence => write!(f, "token_sequence"),
40            Self::Unknown => write!(f, "unknown"),
41        }
42    }
43}