Skip to content

Transformer

Module: strata.base • Kind: trait • Traits: Estimator
Source: strata/base/estimator.mojo

trait Transformer(Estimator)
from strata.base import Transformer

Interface for data preprocessing transformers.


Method Description
Transformer.fit() Fit the estimator to the provided input data.
Transformer.transform() Transform input features using the fitted parameters.
Transformer.fit_transform() Fit the estimator to X and return the transformed output.

def fit[in_dtype: DType](mut self, X: Matrix[in_dtype])

Fit the estimator to the provided input data.

Parameter Type Description
X Matrix[in_dtype] Feature matrix.

def transform[in_dtype: DType](
self,
X: Matrix[in_dtype],
) -> Matrix[in_dtype]

Transform input features using the fitted parameters.

Parameter Type Description
X Matrix[in_dtype] Feature matrix.

Returns: Matrix[in_dtype]


def fit_transform[in_dtype: DType](
mut self,
X: Matrix[in_dtype],
) -> Matrix[in_dtype]

Fit the estimator to X and return the transformed output.

Parameter Type Description
X Matrix[in_dtype] Feature matrix.

Returns: Matrix[in_dtype]