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§
Source§impl IdentityFeatureGroup
impl IdentityFeatureGroup
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§
Source§impl Clone for IdentityFeatureGroup
impl Clone for IdentityFeatureGroup
Source§fn clone(&self) -> IdentityFeatureGroup
fn clone(&self) -> IdentityFeatureGroup
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for IdentityFeatureGroup
impl RefUnwindSafe for IdentityFeatureGroup
impl Send for IdentityFeatureGroup
impl Sync for IdentityFeatureGroup
impl Unpin for IdentityFeatureGroup
impl UnwindSafe for IdentityFeatureGroup
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
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>
Converts
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>
Converts
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 more