L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Productivité · SKILL.md

classification

classification

Guides PyPOTS classification workflows for partially-observed time series, including labels, probability outputs, model selection, metrics, and optional Raindrop dependencies.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: "classification" description: "Guides PyPOTS classification workflows for partially-observed time series, including labels, probability outputs, model selection, metrics, and optional Raindrop dependencies." disable-model-invocation: true metadata: disco-role: operating license: BSD 3-Clause

PyPOTS Classification

Use this sub-skill when the user needs class labels or class probabilities for partially-observed time-series samples.

Natural Triggers

  • "classify time series with PyPOTS"
  • "use Raindrop / TS2Vec / TimesNet / BRITS / CSAI"
  • "get classification_proba"
  • "use predict_proba() or classify()"
  • "why does Raindrop need torch-geometric?"
  • "evaluate ROC-AUC, PR-AUC, F1, precision, or recall"

First References

Scope

This route covers:

  • Classifier models: Raindrop, TS2Vec, TimesNet, BRITS, CSAI, GRUD, SAITS, iTransformer, TEFN, PatchTST, Autoformer, and SeFT.
  • Training with train_set = {"X": X, "y": y}.
  • Probability and class-label extraction.
  • Binary classification metrics exposed through pypots.nn.functional.
  • HDF5 lazy-loading for train/validation/test sets.

Route elsewhere:

Core Workflow

  1. Prepare X with shape [n_samples, n_steps, n_features] and y with one label per sample.
  2. Select a classifier. Use a non-Raindrop model if the environment lacks the torch-geometric stack.
  3. Instantiate the model with n_steps, n_features, n_classes, and the model-specific architecture parameters.
  4. Train with model.fit(train_set, val_set).
  5. Predict with model.predict(test_set) and read:
    • results["classification_proba"] for probabilities.
    • results["classification"] for labels.
  6. Or call predict_proba(test_set) and classify(test_set) directly.
  7. Evaluate with calc_binary_classification_metrics() for binary workflows.

Minimal Example Shape

from pypots.classification import TimesNet

model = TimesNet(
    n_steps=n_steps,
    n_features=n_features,
    n_classes=n_classes,
    n_layers=1,
    top_k=1,
    d_model=16,
    d_ffn=16,
    n_kernels=3,
    epochs=1,
    device="cpu",
)
model.fit({"X": train_X, "y": train_y}, {"X": val_X, "y": val_y})
proba = model.predict_proba({"X": test_X})
labels = model.classify({"X": test_X})

For TS2Vec, predict() can be called with classifier choices such as classifier_type="svm", "knn", or "lr" in the native tests.

Common Decision Points

  • Use pypots-cli model describe --name MODEL --task classification before generating a config; many shared model names differ by task wrapper.
  • Start on CPU and a small fixture before enabling CUDA.
  • Use classification_proba for ranking metrics such as ROC-AUC and PR-AUC.
  • Use classification only when discrete class labels are needed.
  • If Raindrop fails on missing PyG packages, install the compatible PyG stack or choose a non-GNN classifier.

Validation Signals

A successful classification workflow returns probabilities and labels for the same number of samples as the test input. Binary native tests commonly assert a ROC-AUC threshold and log PR-AUC, F1, precision, and recall.

Skills enregistrées