predictive-modeling

Builds leakage-free predictive models with deployment-matched evaluation in R, Python, or Julia.

2|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/lancegui/causal-powers --skill predictive-modeling-lancegui
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: predictive-modeling
Source: https://github.com/lancegui/causal-powers/tree/main/skills/predictive-modeling
Command: npx skills add https://github.com/lancegui/causal-powers --skill predictive-modeling-lancegui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Predictive models often score brilliantly in validation yet fail on the units you actually act on, because of data leakage, random splits that ignore time or entity structure, and metrics that don't match the decision. This Skill enforces an honest evaluation discipline so a reported score survives deployment. ## Core Features & Use Cases - Prediction Spec workflow: Write a seven-row spec (decision, label regime, as-of prediction time, leakage audit, deployment-matched split, metric, baseline) and get sign-off before fitting anything. - Honest evaluation harness: Permutation/null probe, temporal or grouped splits, nested CV with structure-aware inner loops, calibration checks, and trivial-baseline comparisons. - Four label regimes: Guidance for clean labels, proxy/weak labels with selection bias, unsupervised anomaly detection, and ranking/triage at fixed capacity. - Use Case: When ranking pharmacies by diversion risk for a fixed audit capacity, the Skill forces a grouped temporal split, a permutation null check against the base rate, and precision-at-capacity reporting instead of a misleading 0.99 AUC. ## Quick Start Use the predictive-modeling skill to build and honestly evaluate a model that ranks claims by fraud risk for a weekly audit queue.

Frequently Asked Questions about predictive-modeling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent data leakage in machine learning models?▼

Prevent leakage by pinning an as-of prediction time and admitting only features knowable before it, splitting by time or entity group to mirror deployment, and fitting all transforms inside the training fold via a pipeline. Then run a permutation-null probe: shuffled labels must collapse performance to the trivial baseline.

How do I choose a train-test split for time series or grouped data?▼

Choose the split by how the model deploys: forward-chaining (rolling-origin) splits when predicting the future, GroupKFold on the entity key when acting on new entities, and both when both apply. Random splits are valid only for genuine i.i.d. sampling from the deployment population.

What is a permutation test for model validation?▼

A permutation-null probe shuffles the labels within the split structure, refits the entire pipeline, and re-scores it across many permutations. The real model's score must lie well outside this null distribution; if shuffled labels still beat the base-rate baseline, the harness is leaking.

Can I use SHAP or feature importance to make causal claims?▼

No. SHAP and feature importance describe what the model uses to predict, not what causes the outcome. A top-ranked feature correlates with the label; drawing intervention conclusions from it requires a causal identification design, not a predictive model.

How do I evaluate an anomaly detection model without labels?▼

Without ground truth you cannot compute precision or recall, so validate by injecting known positives and confirming they surface, having experts adjudicate the top-k flags, and checking stability across parameters and time windows. Frame the output as triage, not classification.

When should I use precision-at-k instead of AUC?▼

Use precision-at-k when the deliverable is a prioritized queue for fixed capacity, such as auditing 50 claims per week. AUC averages over operating points you will never use; precision-at-capacity directly measures how many of the units you actually act on pay off.