Struct tangram_features::identity::IdentityFeatureGroup [−][src]
pub struct IdentityFeatureGroup { pub source_column_name: String, }
Expand description
An IdentityFeatureGroup
describes the simplest possible feature engineering, which passes a single column from the input table to the output features untouched.
Example
For a number column:
input value | feature value |
---|---|
0.2 | 0.2 |
3.0 | 3.0 |
2.1 | 2.1 |
For an enum column:
use std::num::NonZeroUsize; use tangram_table::prelude::*; EnumTableColumn::new( Some("color".to_owned()), vec!["red".to_owned(), "green".to_owned(), "blue".to_owned()], vec![None, Some(NonZeroUsize::new(1).unwrap()), Some(NonZeroUsize::new(2).unwrap()), Some(NonZeroUsize::new(3).unwrap())], );
value | encoding |
---|---|
“INVALID!” | None |
“red” | Some(1) |
“green” | Some(2) |
“blue” | Some(3) |
input value | feature value |
---|---|
“INVALID!” | None |
“red” | Some(1) |
“green” | Some(2) |
“blue” | Some(3) |
Fields
source_column_name: String
Implementations
pub fn compute_table(
&self,
column: TableColumnView<'_>,
progress: &impl Fn(u64)
) -> TableColumn
pub fn compute_array_f32(
&self,
features: ArrayViewMut2<'_, f32>,
column: TableColumnView<'_>,
progress: &impl Fn()
)
pub fn compute_array_value(
&self,
features: ArrayViewMut2<'_, TableValue<'_>>,
column: TableColumnView<'_>,
progress: &impl Fn()
)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for IdentityFeatureGroup
impl Send for IdentityFeatureGroup
impl Sync for IdentityFeatureGroup
impl Unpin for IdentityFeatureGroup
impl UnwindSafe for IdentityFeatureGroup
Blanket Implementations
Mutably borrows from an owned value. Read more