CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-scikit-learn

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

0.98x
Overview
Eval results
Files

task.mdevals/scenario-3/

Unified Estimator Workflow

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.

Capabilities

Predictive fit

  • Training on features [[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

Transform fit

  • Fitting on features [[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

Combined workflow

  • Calling a single entrypoint that fits once on training features and labels, then returns both the prediction results for [[1.5], [2.5]] and transformed values for the same evaluation data in one call preserves ordering and shapes from the earlier cases. @test

Fit precondition

  • Calling prediction or transformation routines before fitting raises a clear error mentioning the missing fit step. @test

Implementation

@generates

API

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.
        """

Dependencies { .dependencies }

scikit-learn { .dependency }

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-learn

tile.json