data-setup
Prepare NannyML reference/analysis data, choose chunking and thresholds, use bundled datasets, and monitor data quality or summary statistics.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- data-setup
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Prepare NannyML reference/analysis data, choose chunking and thresholds, use bundled datasets, and monitor data quality or summary statistics.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/chunking-and-thresholds.md5.3 KB
- 参考文档references/data-quality.md5.7 KB
- 参考文档references/data-requirements.md4.8 KB
- 参考文档references/summary-stats.md5.0 KB
- 参考文档references/troubleshooting.md3.6 KB
03 SKILL.md 正文
Data Setup
Use this sub-skill when the task is about preparing tabular data for NannyML monitoring, choosing reference/analysis columns, configuring chunks and thresholds, selecting built-in datasets, or running data-quality and summary-statistic calculators.
Route performance estimation/calculation to performance-monitoring, drift detection/ranking to drift-monitoring, and YAML/CLI automation to cli-and-automation.
Quick routing
- Read references/data-requirements.md for reference/analysis periods, timestamp, feature, prediction, probability, target, and joining rules.
- Read references/chunking-and-thresholds.md for
chunk_size,chunk_number,chunk_period, explicit chunkers, and custom thresholds. - Read references/data-quality.md for missing values, unseen values, numerical ranges, and distribution helper calculators.
- Read references/summary-stats.md for average, median, row count, standard deviation, and sum monitors.
- Read references/troubleshooting.md when errors mention missing columns, categorical vs continuous restrictions, invalid chunker args, threshold ordering, too few chunks, or empty datasets.
- Read ../../references/datasets.md to choose a bundled example dataset.
Common setup path
- Choose the data period split: reference for baseline expectations, analysis for monitored records.
- Identify semantic columns: timestamp, model features, prediction label, prediction probability/probabilities, target labels, join keys, and any columns excluded from monitoring.
- Pick chunking: fixed size, fixed count, period-based, or an explicit chunker.
- Decide thresholds: defaults, constant thresholds, or standard-deviation thresholds per metric/method/calculator.
- Run data-quality or summary-stat checks before or alongside drift/performance workflows.
- Convert results to flat DataFrames for assertions/logs and plot only filtered views when the output is large.
Data-quality quick examples
import nannyml as nml
reference, analysis, _ = nml.load_synthetic_car_loan_data_quality_dataset()
all_features = ['car_value', 'salary_range', 'debt_to_income_ratio', 'loan_length', 'repaid_loan_on_prev_car', 'size_of_downpayment', 'driver_tenure']
missing = nml.MissingValuesCalculator(
column_names=all_features,
timestamp_column_name='timestamp',
chunk_size=5000,
).fit(reference).calculate(analysis)
unseen = nml.UnseenValuesCalculator(
column_names=['salary_range', 'repaid_loan_on_prev_car', 'size_of_downpayment'],
timestamp_column_name='timestamp',
chunk_size=5000,
).fit(reference).calculate(analysis)
range_result = nml.NumericalRangeCalculator(
column_names=['car_value', 'debt_to_income_ratio', 'loan_length'],
timestamp_column_name='timestamp',
chunk_size=5000,
).fit(reference).calculate(analysis)
Chunking quick examples
# Fixed-size chunks.
calc = nml.MissingValuesCalculator(column_names=all_features, chunk_size=5000)
# Fixed number of chunks.
calc = nml.MissingValuesCalculator(column_names=all_features, chunk_number=10)
# Time-period chunks require a timestamp column.
calc = nml.MissingValuesCalculator(column_names=all_features, timestamp_column_name='timestamp', chunk_period='W')
# Explicit chunker when incomplete-chunk behavior matters.
chunker = nml.SizeBasedChunker(chunk_size=5000, incomplete='append', timestamp_column_name='timestamp')
calc = nml.MissingValuesCalculator(column_names=all_features, chunker=chunker)
Threshold quick examples
threshold = nml.ConstantThreshold(lower=None, upper=0.02)
missing = nml.MissingValuesCalculator(column_names=['car_value'], threshold=threshold)
thresholds = {'jensen_shannon': nml.StandardDeviationThreshold(std_lower_multiplier=None, std_upper_multiplier=2)}
drift = nml.UnivariateDriftCalculator(column_names=['car_value'], continuous_methods=['jensen_shannon'], thresholds=thresholds)
Decision points
- Use
MissingValuesCalculatorfor NaN/missing-rate or missing-count monitoring. - Use
UnseenValuesCalculatoronly on categorical columns or columns that should be treated as categorical. - Use
NumericalRangeCalculatoronly on continuous columns. - Use summary statistics when the user wants simple aggregate monitors rather than formal drift tests.
- Use
PeriodBasedChunkerorchunk_periodonly when a timestamp column is present and parseable. - Use
to_df(multilevel=False)when exporting or inspecting result columns programmatically. - Use built-in datasets for reproducible examples rather than inventing large fixtures.
Route elsewhere
- CBPE, DLE, realized performance, confusion matrix, or business value -> ../performance-monitoring/SKILL.md
- Univariate/multivariate drift, output/target drift, or rankers -> ../drift-monitoring/SKILL.md
- CLI YAML sections, config discovery, scheduling, writers, or stores -> ../cli-and-automation/SKILL.md
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).