Tutorial

Go from install to first diagnosis in a few minutes.

This walkthrough uses the same curve examples and API patterns that the repository documents in README, quickstart, and CLI usage. Follow it once and you’ll know how to use the package in notebooks, scripts, and training loops.

Install

Use pip install sk-autod or install from source for development.

Diagnose

Call diagnose(train_loss, val_loss) on your loss arrays.

Act

Review the findings, then change LR, capacity, regularization, or early stopping.

1
Install

Get the package ready.

The repository’s installation docs target Python 3.10+ and recommend a simple pip install for end users.

pip install sk-autod
For source installsUse pip install -e ".[dev]" when you want tests, linting, or local editing.
2
Quick diagnosis

Run your first curve through the engine.

The canonical example from the repo uses a steadily falling training curve and a diverging validation curve, which should produce an overfitting finding.

from sk_autod import diagnose train_loss = [2.3, 1.9, 1.4, 0.9, 0.5, 0.3, 0.15] val_loss = [2.4, 2.0, 1.8, 1.9, 2.3, 2.8, 3.4] report = diagnose(train_loss, val_loss) print(report.summary())
report.findings

Use this for structured access to the issues the detector found.

report.to_dict()

Best for logging, APIs, or any JSON-friendly output.

report.to_html()

Creates a shareable report artifact for notebooks or review.

3
One-liner

Use the notebook-friendly shortcut when you only need a summary.

The quick-start guide includes a compact check function for terminal and notebook workflows.

from sk_autod import quick_check print(quick_check(train_loss, val_loss))
Good fitThis is the fastest way to surface whether the curve looks healthy, overfitted, noisy, or stalled.
4
Training loop

Embed SK-AutoD while training.

The README and guide docs both point to a periodic check pattern that fits directly into your epoch loop.

train_losses, val_losses = [], [] for epoch in range(100): # ... your training step ... train_losses.append(train_loss_this_epoch) val_losses.append(val_loss_this_epoch) if epoch % 10 == 0 and epoch >= 5: print(quick_check(train_losses, val_losses))
Why this worksYou do not need a framework integration to get value. The package works on raw arrays, so it can sit beside PyTorch, Keras, or a custom loop.
5
Custom detectors

Extend the library with your own signal.

Custom detectors are part of the documented API. Keep them deterministic and focused on one pathology.

from sk_autod.detectors.base import BaseDetector from sk_autod.core.models import Finding, Severity class MyDetector(BaseDetector): name = "my_custom_issue" def detect(self, report): if report.train_loss[-1] > 1.0: return [Finding( detector_name=self.name, severity=Severity.MEDIUM, confidence=0.8, message="Final training loss is still high.", recommendation="Train longer or increase model capacity.", )] return []
6
CLI

Use the same engine from the terminal.

The CLI mirrors the Python API and is useful for scripts, ad hoc checks, and CI jobs that need a fast pass/fail signal.

sk-autod diagnose \ --train-loss 2.3 1.9 1.4 0.9 0.5 0.3 0.15 \ --val-loss 2.4 2.0 1.8 1.9 2.3 2.8 3.4 \ --output json
7
What to watch for

Let the findings drive the next experiment.

The repository’s detector table maps common failure modes to concrete next actions. Use that as your iteration loop.

Overfitting

Dropout, L2 regularization, less capacity.

Exploding gradients

Gradient clipping and lower learning rate.

Underfitting

Train longer or increase model size.

Slow convergence

Raise LR or adjust the schedule.