Skip to main content

Crate featrs

Crate featrs 

Source
Expand description

featrs — feature engineering for Rust, inspired by scikit-learn.

Built on Polars, all transformations operate on DataFrame and preserve column names throughout.

§Quick start

use featrs::prelude::*;
use polars::prelude::{Column, DataFrame, NamedFrom, Series};

let col = Column::from(Series::new("x".into(), &[1.0_f64, 2.0, 3.0]));
let df = DataFrame::new(3, vec![col])?;

let mut scaler = StandardScaler::new();
scaler.fit(df.clone())?;
let scaled = scaler.transform(df)?;
assert_eq!(scaled.height(), 3);

§Modules

ModuleDescription
preludeConvenient glob-import of the most common types
preprocessingScaling, encoding, normalization, imputation, binarization, polynomial features, feature hashing, auto-type detection
pipelinePipeline (sequential) and ColumnTransformer (per-column transforms)
feature_selectionVarianceThreshold, SelectKBest with ANOVA F-value scoring
traitsCore Fit, Transform, FitTransform traits and error types
time_seriesLag features, rolling windows, difference, cyclical encoding

Re-exports§

pub use crate::prelude::*;

Modules§

feature_selection
Feature selection transformers.
pipeline
Pipeline composition utilities.
prelude
Convenient glob import of the most common types.
preprocessing
Data preprocessing transformations.
time_series
Time-series feature engineering.
traits
Core traits and error types for the featrs library.
util
Shared helpers for transformers operating on Float64 columns.