Struct tangram_features::normalized::NormalizedFeatureGroup [−][src]
pub struct NormalizedFeatureGroup { pub source_column_name: String, pub mean: f32, pub variance: f32, }
Expand description
A NormalizedFeatureGroup
transforms a number column to zero mean and unit variance. [Learn more](https://en.wikipedia.org/wiki/Feature_scaling#Standardization_(Z-score_Normalization).
Example
use tangram_table::prelude::*; NumberTableColumn::new( Some("values".to_owned()), vec![0.0, 5.2, 1.3, 10.0], );
Mean: 2.16667
Standard Deviation: 2.70617
feature_value = (value - mean) / std
input value | feature value |
---|---|
0.0 | (0.0 - 2.16667) / 2.70617 = -0.80064 |
5.2 | (5.2 - 2.16667) / 2.70617 = 1.12089 |
1.3 | (1.3 - 2.16667) / 2.70617 = -0.32026 |
Fields
source_column_name: String
mean: f32
variance: f32
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 NormalizedFeatureGroup
impl Send for NormalizedFeatureGroup
impl Sync for NormalizedFeatureGroup
impl Unpin for NormalizedFeatureGroup
impl UnwindSafe for NormalizedFeatureGroup
Blanket Implementations
Mutably borrows from an owned value. Read more