MCP HubMCP Hub
Volver a habilidades

review-data-analysis

pjt222
Actualizado 2 days ago
3 vistas
17
2
17
Ver en GitHub
Pruebasdata

Acerca de

Esta Habilidad de Claude revisa las pipelines de análisis de datos en cuanto a calidad, corrección y reproducibilidad. Realiza comprobaciones de calidad de datos, validación de modelos, verificación de supuestos y detección de fugas de datos. Úsala para validar pipelines de ML antes de producción, auditar informes para la toma de decisiones o realizar revisiones por pares en entornos regulados.

Instalación rápida

Claude Code

Recomendado
Principal
npx skills add pjt222/agent-almanac -a claude-code
Comando PluginAlternativo
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternativo
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/review-data-analysis

Copia y pega este comando en Claude Code para instalar esta habilidad

Documentación

Review Data Analysis

Evaluate a data analysis pipeline for correctness, robustness, and reproducibility.

When to Use

  • Reviewing a colleague's analysis notebook or script before publication
  • Validating a machine learning pipeline before production deployment
  • Auditing an analytical report for regulatory or business decision-making
  • Assessing whether an analysis supports its stated conclusions
  • Performing a second-analyst review in a regulated environment

Inputs

  • Required: Analysis code (scripts, notebooks, or pipeline definitions)
  • Required: Analysis output (results, tables, figures, model metrics)
  • Optional: Raw data or data dictionary
  • Optional: Analysis plan or protocol (pre-registered or ad-hoc)
  • Optional: Target audience and decision context

Procedure

Step 1: Assess Data Quality

Review the input data before evaluating the analysis:

## Data Quality Assessment

### Completeness
- [ ] Missing data quantified (% by column and by row)
- [ ] Missing data mechanism considered (MCAR, MAR, MNAR)
- [ ] Imputation method appropriate (if used) or complete-case analysis justified

### Consistency
- [ ] Data types match expectations (dates are dates, numbers are numbers)
- [ ] Value ranges are plausible (no negative ages, future dates in historical data)
- [ ] Categorical variables have expected levels (no misspellings, consistent coding)
- [ ] Units are consistent across records

### Uniqueness
- [ ] Duplicate records identified and handled
- [ ] Primary keys are unique where expected
- [ ] Join operations produce expected row counts (no fan-out or drop)

### Timeliness
- [ ] Data vintage appropriate for the analysis question
- [ ] Temporal coverage matches the study period
- [ ] No look-ahead bias in time-series data

### Provenance
- [ ] Data source documented
- [ ] Extraction date/version recorded
- [ ] Any transformations between source and analysis input documented

Got: Data quality issues documented with their potential impact on results. If fail: If data is not accessible for review, assess quality from the code (what checks and transformations are applied).

Step 2: Check Assumptions

For each statistical method or model used:

MethodKey AssumptionsHow to Check
Linear regressionLinearity, independence, normality of residuals, homoscedasticityResidual plots, Q-Q plot, Durbin-Watson, Breusch-Pagan
Logistic regressionIndependence, no multicollinearity, linear logitVIF, Box-Tidwell, residual diagnostics
t-testIndependence, normality (or large n), equal varianceShapiro-Wilk, Levene's test, visual inspection
ANOVAIndependence, normality, homogeneity of varianceShapiro-Wilk per group, Levene's test
Chi-squaredIndependence, expected frequency ≥ 5Expected frequency table
Random forestSufficient training data, feature relevanceOOB error, feature importance, learning curves
Neural networkSufficient data, appropriate architecture, no data leakageValidation curves, overfitting checks
## Assumption Check Results
| Analysis Step | Method | Assumption | Checked? | Result |
|---------------|--------|------------|----------|--------|
| Primary model | Linear regression | Normality of residuals | Yes | Q-Q plot shows mild deviation — acceptable for n>100 |
| Primary model | Linear regression | Homoscedasticity | No | Not checked — recommend adding Breusch-Pagan test |

Got: Every statistical method has its assumptions explicitly checked or acknowledged. If fail: If assumptions are violated, check whether the authors addressed this (robust methods, transformations, sensitivity analysis).

Step 3: Detect Data Leakage

Data leakage occurs when information from outside the training set influences the model, leading to over-optimistic performance:

Common leakage patterns:

  • Target leakage: Feature that directly encodes the target variable (e.g., "treatment_outcome" used to predict "treatment_success")
  • Temporal leakage: Future information used to predict the past (features computed from data that wouldn't be available at prediction time)
  • Train-test contamination: Preprocessing (scaling, imputation, feature selection) fitted on full dataset before splitting
  • Group leakage: Related observations (same patient, same device) split across train and test sets
  • Feature engineering leakage: Aggregates computed across the entire dataset rather than within the training fold
## Leakage Assessment
| Check | Status | Evidence |
|-------|--------|----------|
| Target leakage | Clear | No features derived from target |
| Temporal leakage | CONCERN | Feature X uses 30-day forward average |
| Train-test contamination | Clear | StandardScaler fit on train only |
| Group leakage | CONCERN | Patient IDs not used for stratified split |

Got: All common leakage patterns checked with clear/concern status. If fail: If leakage is found, estimate its impact by re-running without the leaked feature (if possible) or flag for the analyst to investigate.

Step 4: Validate Model Performance

For predictive models:

  • Appropriate metrics for the problem (not just accuracy — consider precision, recall, F1, AUC, RMSE, MAE)
  • Cross-validation or holdout strategy described and appropriate
  • Performance on training vs. test/validation set compared (overfitting check)
  • Baseline comparison provided (naive model, random chance, previous approach)
  • Confidence intervals or standard errors on performance metrics
  • Performance evaluated on relevant subgroups (fairness, edge cases)

For inferential/explanatory models:

  • Model fit statistics reported (R², AIC, BIC, deviance)
  • Coefficients interpreted correctly (direction, magnitude, significance)
  • Multicollinearity assessed (VIF < 5–10)
  • Influential observations identified (Cook's distance, leverage)
  • Model comparison if multiple specifications tested

Got: Model validation appropriate for the use case (prediction vs. inference). If fail: If test set performance is suspiciously close to training performance, flag potential leakage.

Step 5: Assess Reproducibility

## Reproducibility Checklist
| Item | Status | Notes |
|------|--------|-------|
| Code runs without errors | [Yes/No] | Tested on [environment description] |
| Random seeds set | [Yes/No] | Line [N] in [file] |
| Dependencies documented | [Yes/No] | requirements.txt / renv.lock present |
| Data loading reproducible | [Yes/No] | Path is [relative/absolute/URL] |
| Results match reported values | [Yes/No] | Verified: Table 1 ✓, Figure 2 ✗ (minor discrepancy) |
| Environment documented | [Yes/No] | Python 3.11 / R 4.5.0 specified |

Got: Reproducibility verified by re-running the analysis (or assessing from code if data is unavailable). If fail: If results don't reproduce exactly, determine if differences are within floating-point tolerance or indicate a problem.

Step 6: Write the Review

## Data Analysis Review

### Overall Assessment
[1-2 sentences: Is the analysis sound? Does it support the conclusions?]

### Data Quality
[Summary of data quality findings, impact on results]

### Methodological Concerns
1. **[Title]**: [Description, location in code/report, suggestion]
2. ...

### Strengths
1. [What was done well]
2. ...

### Reproducibility
[Tier assessment: Gold/Silver/Bronze/Opaque with justification]

### Recommendations
- [ ] [Specific action items for the analyst]

Got: Review provides actionable feedback with specific references to code locations. If fail: If time-constrained, prioritize data quality and leakage checks over style issues.

Validation

  • Data quality assessed across completeness, consistency, uniqueness, timeliness, provenance
  • Statistical assumptions checked for each method used
  • Data leakage systematically assessed
  • Model performance validated with appropriate metrics and baselines
  • Reproducibility evaluated (code runs, results match)
  • Feedback is specific, referencing code lines or report sections
  • Tone is constructive and collaborative

Pitfalls

  • Reviewing only the code: The analysis plan and conclusions matter as much as the implementation.
  • Ignoring data quality: Sophisticated models on bad data produce confident wrong answers.
  • Assuming correctness from complexity: A random forest with 95% accuracy might have data leakage; a simple t-test might be the correct approach.
  • Not running the code: If at all possible, execute the code to verify reproducibility. Reading code is not sufficient.
  • Missing the forest for the trees: Don't get lost in code style issues while missing a fundamental analytical error.

Related Skills

  • review-research — broader research methodology and manuscript review
  • validate-statistical-output — double-programming verification methodology
  • generate-statistical-tables — publication-ready statistical tables
  • review-software-architecture — code structure and design review

Repositorio GitHub

pjt222/agent-almanac
Ruta: i18n/caveman-lite/skills/review-data-analysis
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

Habilidades relacionadas

evaluating-llms-harness

Pruebas

Esta Skill de Claude ejecuta el benchmark lm-evaluation-harness para evaluar modelos de lenguaje en más de 60 tareas académicas estandarizadas como MMLU y GSM8K. Está diseñada para que los desarrolladores comparen la calidad de los modelos, realicen seguimiento del progreso del entrenamiento o reporten resultados académicos. La herramienta admite varios backends, incluidos modelos de HuggingFace y vLLM.

Ver habilidad

cloudflare-cron-triggers

Pruebas

Esta habilidad proporciona conocimiento integral para implementar Cron Triggers de Cloudflare y programar Workers mediante expresiones cron. Cubre la configuración de tareas periódicas, trabajos de mantenimiento y flujos de trabajo automatizados, manejando problemas comunes como expresiones cron inválidas y inconvenientes de zonas horarias. Los desarrolladores pueden utilizarla para configurar manejadores programados, probar activadores cron e integrar con Workflows y Green Compute.

Ver habilidad

webapp-testing

Pruebas

Esta habilidad de Claude proporciona un kit de herramientas basado en Playwright para probar aplicaciones web locales mediante scripts de Python. Permite verificación de frontend, depuración de interfaz de usuario, captura de pantallas y visualización de registros, mientras gestiona los ciclos de vida del servidor. Úsela para tareas de automatización de navegadores, pero ejecute los scripts directamente en lugar de leer su código fuente para evitar contaminación del contexto.

Ver habilidad

finishing-a-development-branch

Pruebas

Esta habilidad ayuda a los desarrolladores a completar el trabajo terminado verificando que las pruebas pasen y luego presentando opciones estructuradas de integración. Guía el flujo de trabajo para fusionar, crear PRs o limpiar ramas después de que se completa la implementación. Úsala cuando tu código esté listo y probado para finalizar sistemáticamente el proceso de desarrollo.

Ver habilidad