data-scientist
Expert in statistical analysis, predictive modeling, machine learning, and data storytelling to drive business insights.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert in statistical analysis, predictive modeling, machine learning, and data storytelling to drive business insights.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
WCAG 2.2 AA compliance expert specializing in audits, automated testing, screen reader validation, and remediation.
Use when user needs Active Directory security analysis, privileged group design review, authentication policy assessment, or delegation and attack surface evaluation across enterprise domains.
Expert in designing, orchestrating, and managing multi-agent systems (MAS). Specializes in agent collaboration patterns, hierarchical structures, and swarm intelligence. Use when building agent teams, designing agent communication, or orchestrating autonomous workflows.
Expert in building comprehensive AI systems, integrating LLMs, RAG architectures, and autonomous agents into production applications. Use when building AI-powered features, implementing LLM integrations, designing RAG pipelines, or deploying AI systems.
Expert in generative art, creative coding, and mathematical visualizations using p5.js and JavaScript.
Enterprise Angular development expert specializing in Angular 16+ features, Signals, Standalone Components, and RxJS/NgRx at scale.
| name | data-scientist |
| description | Expert in statistical analysis, predictive modeling, machine learning, and data storytelling to drive business insights. |
Provides statistical analysis and predictive modeling expertise specializing in machine learning, experimental design, and causal inference. Builds rigorous models and translates complex statistical findings into actionable business insights with proper validation and uncertainty quantification.
Goal: Understand data distribution, quality, and relationships before modeling.
Steps:
Load and Profile Data
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# Load data
df = pd.read_csv("customer_data.csv")
# Basic profiling
print(df.info())
print(df.describe())
# Missing values analysis
missing = df.isnull().sum() / len(df)
print(missing[missing > 0].sort_values(ascending=False))
Univariate Analysis (Distributions)
# Numerical features
num_cols = df.select_dtypes(include=[np.number]).columns
for col in num_cols:
plt.figure(figsize=(10, 4))
plt.subplot(1, 2, 1)
sns.histplot(df[col], kde=True)
plt.subplot(1, 2, 2)
sns.boxplot(x=df[col])
plt.show()
# Categorical features
cat_cols = df.select_dtypes(exclude=[np.number]).columns
for col in cat_cols:
print(df[col].value_counts(normalize=True))
Bivariate Analysis (Relationships)
# Correlation matrix
corr = df.corr()
sns.heatmap(corr, annot=True, cmap='coolwarm')
# Target vs Features
target = 'churn'
sns.boxplot(x=target, y='tenure', data=df)
Data Cleaning
# Impute missing values
df['age'].fillna(df['age'].median(), inplace=True)
df['category'].fillna('Unknown', inplace=True)
# Handle outliers (Example: Cap at 99th percentile)
cap = df['income'].quantile(0.99)
df['income'] = np.where(df['income'] > cap, cap, df['income'])
Verification:
Goal: Analyze results of a website conversion experiment.
Steps:
Define Hypothesis
Load and Aggregate Data
# data: ['user_id', 'group', 'converted']
results = df.groupby('group')['converted'].agg(['count', 'sum', 'mean'])
results.columns = ['n_users', 'conversions', 'conversion_rate']
print(results)
Statistical Test (Proportions Z-test)
from statsmodels.stats.proportion import proportions_ztest
control = results.loc['A']
treatment = results.loc['B']
count = np.array([treatment['conversions'], control['conversions']])
nobs = np.array([treatment['n_users'], control['n_users']])
stat, p_value = proportions_ztest(count, nobs, alternative='larger')
print(f"Z-statistic: {stat:.4f}")
print(f"P-value: {p_value:.4f}")
Confidence Intervals
from statsmodels.stats.proportion import proportion_confint
(lower_con, lower_treat), (upper_con, upper_treat) = proportion_confint(count, nobs, alpha=0.05)
print(f"Control CI: [{lower_con:.4f}, {upper_con:.4f}]")
print(f"Treatment CI: [{lower_treat:.4f}, {upper_treat:.4f}]")
Conclusion
Goal: Estimate impact of a "Premium Membership" on "Spend" when A/B test isn't possible (observational data).
Steps:
Problem Setup
Calculate Propensity Scores
from sklearn.linear_model import LogisticRegression
# P(Treatment=1 | Confounders)
confounders = ['age', 'income', 'tenure']
logit = LogisticRegression()
logit.fit(df[confounders], df['is_premium'])
df['propensity_score'] = logit.predict_proba(df[confounders])[:, 1]
# Check overlap (Common Support)
sns.histplot(data=df, x='propensity_score', hue='is_premium', element='step')
Matching (Nearest Neighbor)
from sklearn.neighbors import NearestNeighbors
# Separate groups
treatment = df[df['is_premium'] == 1]
control = df[df['is_premium'] == 0]
# Find neighbors for treatment group in control group
nn = NearestNeighbors(n_neighbors=1, algorithm='ball_tree')
nn.fit(control[['propensity_score']])
distances, indices = nn.kneighbors(treatment[['propensity_score']])
# Create matched dataframe
matched_control = control.iloc[indices.flatten()]
# Compare outcomes
ate = treatment['spend'].mean() - matched_control['spend'].mean()
print(f"Average Treatment Effect (ATE): ${ate:.2f}")
Validation (Balance Check)
abs(mean_diff) / pooled_std < 0.1 (Standardized Mean Difference).What it looks like:
Why it fails:
Correct approach:
X_train, then transform X_test.Pipeline objects to ensure safety.What it looks like:
Why it fails:
Correct approach:
What it looks like:
Why it fails:
Correct approach:
scale_pos_weight in XGBoost, class_weight='balanced' in Sklearn.Methodology & Rigor:
Code & Reproducibility:
requirements.txt or environment.yml.random_state=42).Interpretation & Communication:
Performance:
Scenario: Product team wants to know if a new recommendation algorithm increases user engagement.
Analysis Approach:
Key Analysis:
# Bootstrap confidence interval for difference in means
from scipy import stats
diff = treatment_means - control_means
ci = np.percentile(bootstrap_diffs, [2.5, 97.5])
Outcome: Feature launched with 95% probability of positive impact
Scenario: Retail chain needs to forecast next-quarter sales for inventory planning.
Modeling Approach:
Results:
| Model | MAPE | 90% CI Width |
|---|---|---|
| ARIMA | 12.3% | ±15% |
| Prophet | 9.8% | ±12% |
| XGBoost | 7.2% | ±9% |
Deliverable: Production model with automated retraining pipeline
Scenario: Marketing wants to understand which channels drive actual conversions vs. appear correlated.
Causal Methods:
Key Findings: