tessl install tessl/pypi-scikit-learn@1.7.0A comprehensive machine learning library providing supervised and unsupervised learning algorithms with consistent APIs and extensive tools for data preprocessing, model evaluation, and deployment.
Agent Success
Agent success rate when using this tile
87%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.99x
Baseline
Agent success rate without this tile
88%
Build a module that learns unsupervised detectors for global and local anomalies, estimates robust covariance distances, and discovers biclusters in a rectangular dataset.
@generates
import numpy as np
from typing import Tuple
class AnomalySuite:
def fit_global(self, samples: np.ndarray, contamination: float = 0.1) -> "AnomalySuite":
"""Fit a global anomaly detector on 2D numeric samples."""
def predict_global(self, samples: np.ndarray) -> np.ndarray:
"""Return a boolean array marking anomalies in the provided samples."""
def fit_local(self, samples: np.ndarray, neighbors: int = 20) -> "AnomalySuite":
"""Fit a neighborhood-sensitive anomaly detector."""
def score_local(self, samples: np.ndarray) -> np.ndarray:
"""Return anomaly scores where higher values indicate stronger outlierness."""
def fit_covariance(self, samples: np.ndarray) -> "AnomalySuite":
"""Estimate a robust covariance model from the samples."""
def mahalanobis_distance(self, samples: np.ndarray) -> np.ndarray:
"""Compute robust Mahalanobis-style distances for each sample."""
def fit_biclusters(self, matrix: np.ndarray, n_clusters: int) -> "AnomalySuite":
"""Fit biclusters on a 2D matrix representing feature-by-sample signals."""
def bicluster_assignments(self) -> Tuple[np.ndarray, np.ndarray]:
"""Return row and column cluster labels from the last biclustering fit."""Provides unsupervised anomaly detection, covariance estimation, and biclustering utilities.