A comprehensive machine learning library providing supervised and unsupervised learning algorithms with consistent APIs and extensive tools for data preprocessing, model evaluation, and deployment.
87
A small workflow layer that demonstrates the shared training and inference contract across estimators that expose fit, predict, and transform. Entry points reuse the same train/eval argument order to keep behaviour straightforward.
[[0.0], [1.0], [2.0], [3.0]] with labels [0, 0, 1, 1] and then evaluating on [[1.5], [2.5]] returns predictions [0, 1] in that order. @test[[0.0], [2.0]] and then transforming [[0.0], [2.0]] yields column-wise zero mean and unit variance results close to [[-1.0], [1.0]]. @test[[1.5], [2.5]] and transformed values for the same evaluation data in one call preserves ordering and shapes from the earlier cases. @test@generates
from typing import Any, Iterable, List, Optional, Sequence, Tuple
class UnifiedWorkflow:
def __init__(self, predictor: Any, transformer: Any):
"""
predictor: an estimator exposing fit/train and predict-style inference.
transformer: an estimator exposing fit-style training and transform-style conversion.
"""
def fit(self, train_features: Sequence[Sequence[float]], train_labels: Optional[Sequence[Any]] = None) -> None:
"""
Fits available components on the provided training data.
"""
def predict(self, eval_features: Sequence[Sequence[float]]) -> List[Any]:
"""
Runs inference using the fitted predictor on the provided evaluation features.
"""
def transform(self, eval_features: Sequence[Sequence[float]]) -> List[List[float]]:
"""
Runs feature conversion using the fitted transformer on the provided evaluation features.
"""
def fit_predict(self, train_features: Sequence[Sequence[float]], train_labels: Sequence[Any], eval_features: Sequence[Sequence[float]]) -> List[Any]:
"""
Fits the predictor on training data, then returns predictions for the evaluation data.
"""
def fit_transform(self, train_features: Sequence[Sequence[float]], eval_features: Sequence[Sequence[float]]) -> List[List[float]]:
"""
Fits the transformer on training data, then returns transformed values for the evaluation data.
"""
def fit_predict_transform(
self,
train_features: Sequence[Sequence[float]],
train_labels: Sequence[Any],
eval_features: Sequence[Sequence[float]],
) -> Tuple[List[Any], List[List[float]]]:
"""
Fits once, then returns both predictions and transformed evaluation features in a single call.
"""Provides estimators that expose consistent fit, predict, and transform routines for both predictive models and feature transformers.
Install with Tessl CLI
npx tessl i tessl/pypi-scikit-learndocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10