AGENT SKILL

evaluation-splitting

Evaluate fitted LightFM recommenders and create leakage-safe train/test splits.

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

01 前言 Front Matter

name
evaluation-splitting
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Evaluate fitted LightFM recommenders and create leakage-safe train/test splits.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

LightFM evaluation and splitting

Use this sub-skill when a task is about offline ranking metrics, train/test splits, or debugging leakage in a fitted LightFM recommender.

Read when

  • Compute precision_at_k, recall_at_k, auc_score, reciprocal_rank, or LightFM.predict_rank for a fitted model.
  • Split an interactions matrix with random_train_test_split and validate that train and test interactions do not overlap.
  • Explain train_interactions, check_intersections, preserve_rows, metric output shapes, top-k behavior, rank values, or tie handling.
  • Diagnose intersection ValueError, suspiciously high test metrics, empty metric arrays, zero-row users, sparse matrix input problems, or num_threads errors.

Route elsewhere

  • Training, tuning, resuming, serializing, direct predict scoring, or loss selection: read model-training.
  • Dataset mappings, feature matrix construction, built-in dataset fetchers, cold-start feature design, or interaction schemas: read data-features.
  • Repository build, editable install, compiled extension maintenance, native tests, or CI commands: read repo-development.

Fast workflow

  1. Start from a fitted lightfm.LightFM model and SciPy sparse train/test matrices with identical (n_users, n_items) shape. If the model was fit with user or item features, pass compatible feature matrices into the metric call as well.
  2. Treat non-zero entries in test_interactions as positives to rank. Remove or zero-out negative feedback before ranking metrics; LightFM evaluation treats any non-zero entry as an interaction.
  3. Pass train_interactions=train for test metrics so known training positives are excluded from the candidate ranking. Keep check_intersections=True unless performing an intentional diagnostic.
  4. Choose preserve_rows=False for aggregate means over users with test positives, or preserve_rows=True when the output must stay aligned to the original user axis.
  5. Inspect API details for signatures, return shapes, sparse matrix expectations, intersection checks, and tie semantics.
  6. Use workflows for leakage-safe split/evaluate recipes, user-preserving metrics, and predict_rank interpretation.
  7. Use troubleshooting when metrics error, look optimistic, contain zero/empty rows, or disagree with expected top-k behavior.

A deterministic, no-network fixture is bundled at scripts/evaluate_lightfm_fixture.py. It trains a tiny CPU model, computes all ranking metrics, validates a random split, and can intentionally demonstrate intersection handling.

Non-negotiables for leakage-safe evaluation

  • Do not average test metrics without checking that train/test matrices are disjoint at non-zero coordinates.
  • Do not silence intersection checks just to get a score; fix the split unless the task is explicitly evaluating training-set ranking behavior.
  • Do not compare metrics across runs unless k, split policy, feature matrices, preserve_rows, and train-interaction filtering are the same.
  • Do not interpret random splits as temporal validation. Use a chronological or user-aware holdout when production evaluation requires it, then still validate intersections before scoring.

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