Skip to content

Regressor

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

trait Regressor(Estimator)
from strata.base import Regressor

Interface for supervised regression models.


Method Description
Regressor.fit() Fit the regressor to training data (X, y).
Regressor.predict() Predict continuous target values for input samples.

def fit[feat_dtype: DType, target_dtype: DType](
mut self,
X: Matrix[feat_dtype],
y: List[Scalar[target_dtype]],
)

Fit the regressor to training data (X, y).

Parameter Type Description
X Matrix[feat_dtype] Feature matrix.
y List[Scalar[target_dtype]] Target vector / class labels.

def predict[feat_dtype: DType](
self,
X: Matrix[feat_dtype],
) -> List[Scalar[feat_dtype]]

Predict continuous target values for input samples.

Parameter Type Description
X Matrix[feat_dtype] Feature matrix.

Returns: List[Scalar[feat_dtype]]