AGENT SKILL

imbalanced-learn

Router for imbalanced-learn samplers, workflows, metrics, datasets, and balanced batch generators.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
imbalanced-learn
license
MIT
metadata
{ "disco-role": "operating" }
description
Router for imbalanced-learn samplers, workflows, metrics, datasets, and balanced batch generators.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

imbalanced-learn

Use this repo skill for the imbalanced-learn package when the task is about class imbalance, resampling, imbalance-aware pipelines, evaluation metrics, or balanced mini-batches for Keras/TensorFlow.

The import root is imblearn. The package is scikit-learn compatible and is centered on fit_resample workflows for tabular and scientific-python style data.

Quick start

  • If you need the package API, start with this router and then read the relevant sub-skill.
  • If you need a fast sanity check, run scripts/package_smoke.py.
  • If you need live API names or signatures from the installed environment, run scripts/inspect_signatures.py.

Minimal import check

from imblearn import FunctionSampler
from imblearn.over_sampling import RandomOverSampler

If that import fails, read references/troubleshooting.md before assuming the repo skill is stale.

How to choose a sub-skill

sampling-algorithms

Use this when the request mentions:

  • RandomOverSampler, SMOTE, ADASYN, SMOTENC, SMOTEN
  • RandomUnderSampler, TomekLinks, EditedNearestNeighbours, NearMiss
  • ClusterCentroids, SMOTEENN, SMOTETomek
  • FunctionSampler, sampling_strategy, check_sampling_strategy
  • sparse, pandas, heterogeneous, or categorical feature handling during resampling

Read sub-skills/sampling-algorithms/SKILL.md first.

model-workflows

Use this when the request mentions:

  • Pipeline or make_pipeline
  • leakage-safe resampling with classifiers
  • BalancedBaggingClassifier, BalancedRandomForestClassifier
  • EasyEnsembleClassifier, RUSBoostClassifier
  • InstanceHardnessCV

Read sub-skills/model-workflows/SKILL.md first.

evaluation-and-data

Use this when the request mentions:

  • make_imbalance, fetch_datasets
  • classification_report_imbalanced, geometric_mean_score
  • sensitivity/specificity metrics, MA-MAE, or ValueDifferenceMetric
  • data-leakage pitfalls and dataset-balancing examples

Read sub-skills/evaluation-and-data/SKILL.md first.

optional-batch-generators

Use this when the request mentions:

  • balanced_batch_generator
  • BalancedBatchGenerator
  • Keras or TensorFlow mini-batch workflows for imbalanced data

Read sub-skills/optional-batch-generators/SKILL.md first.

Cross-cutting rules

  • Resample only the training split, not the entire dataset, when the user is trying to avoid leakage.
  • Preserve sparse inputs as CSR-compatible workflows where possible, but know that many samplers return dense output.
  • Treat pandas support as first-class when the user provides DataFrames.
  • Treat TensorFlow/Keras support as optional: useful, but not required for the core CPU package.
  • When a workflow needs the exact constructor or signature of a public class or function, consult the nearest reference file or run scripts/inspect_signatures.py.

Read these files when needed

  • references/api-overview.md for the compact module and symbol map.
  • references/troubleshooting.md for install, import, dtype, sparse, leakage, network, and optional-backend issues.
  • references/repo-provenance.md for the source snapshot that produced this skill.
  • references/repo-routing-metadata.json for managed-router placement data.

Root scripts

  • scripts/package_smoke.py for a small end-to-end CPU and optional-backend smoke check.
  • scripts/inspect_signatures.py for live API introspection from the installed environment.

What this skill does not do

  • It does not replace the sub-skill-level workflow guides.
  • It does not ask you to run the original repository examples as runtime skill instructions.
  • It does not claim GPU-specific functionality; the package is CPU-oriented, with optional TensorFlow/Keras dependencies.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351