가장 간단한 모델(Dummy, Linear)로 성능 하한선(Baseline)을 설정하고 이를 넘어서는지 확인합니다.
Feature Engineering:
SKILL.md 리스트의 기법(Encoding, Scaling, PCA)을 적용합니다.
4.3 Advanced Modeling & Tuning
Model Selection: 선정된 고성능 모델(XGBoost, CatBoost, RF 등)을 학습합니다.
Hyperparameter Tuning: 단순히 Grid Search를 넘어 Optuna 등을 활용해 효율적으로 최적화합니다.
Rigorous Validation: Cross Validation 점수와 Hold-out Test 점수의 차이를 확인하여 오버피팅을 감지합니다. (Gap > 5% 시 경고)
Clustering: K-Means 등을 사용할 경우 Elbow Method나 Silhouette Score로 최적의 군집 수(K)를 결정합니다.
Rigorous Validation:
Stratified K-Fold를 사용하여 과적합을 방지하고 일반화 성능을 평가합니다.
Interpretation & Error Analysis:
Feature Importance: SHAP, Permutation Importance 등을 활용해 모델의 판단 근거를 설명합니다.
Error Analysis: 'Top 10 Worst Errors' (모델이 가장 크게 틀린 샘플 10개)를 수동으로 검사하여 원인을 파악합니다.
Reporting:
기술적 수치(Accuracy, MSE)를 비즈니스 언어(예상 수익, 리스크 감소)로 번역하여 보고합니다.
Standards & Rules
Data Analyst Standards (OSEMN)
Purpose
To transform raw data into actionable business insights using a rigorous, hypothesis-driven approach.
Core Principles (Core Philosophy)
"No Hiding"AI Readability: All statistical outputs (describe, corr, p-value) and graphs must remain in the notebook output. This ensures tools like NotebookLM can contextually understand the analysis.
Quality Standards (Tier 1 Best Practices)
1. Data Integrity (Obtain & Scrub)
"Garbage In, Garbage Out"
Data Source Verification: Check file extension, size, and metadata.
Data Quality Check:
Missing Values: Identify mechanism (MCAR, MAR, MNAR) before imputing.
Logical Failures: Check for impossible values (e.g., age < 0, future dates), Data Leakage, and Overfitting indicators.
Data Types: Ensure numeric cols are not strings, etc.
File Handling Standards:
Excel (.xlsx): Preserve existing formatting/formulas. Use openpyxl for editing, pandas for reading. Zero Hardcoding of calculated values.
Handles Mixed types, Robust to outliers/missing values
XGBoost / LightGBM
Ensemble
High Performance
Large datasets, handles missing values internally
CatBoost
Ensemble
Best for Categorical Features
Handles categories automatically, Slower training
Isolation Forest
Anomaly Detection
Outlier/Anomaly Detection
High dimensional data, efficiency
K-Means
Clustering
Partitioning into K clusters
Spherical Clusters, Sensitive to outliers, Scale-sensitive
DBSCAN
Clustering
Density-based clustering, Detects Outliers
Arbitrary shapes, Scale-sensitive, finding epsilon is hard
Hierarchical
Clustering
Dendrogram visualization
Computationally expensive for large data
3. Deep Learning Models
Methodology
Usage / Purpose
Data Constraints
CNN
Image/Pattern Recognition
Grid-like data (Images, etc.)
RNN / LSTM
Sequence/Time-Series Prediction
Sequential data
Transformer
NLP, Complex Pattern Matching
Long sequences, Large-scale data
4. Validation & Optimization
Methodology
Type
Usage / Purpose
Notes
Stratified K-Fold
Validation
Cross Validation (Generalization)
Essential for Imbalanced Class distribution
K-Fold CV
Validation
Cross Validation
Sufficient data, Balanced classes
Time Series Split
Validation
Cross Validation (Temporal)
No future data leakage (essential for time-series)
Grid Search
Tuning
Hyperparameter Optimization
Small search space (Exhaustive)
Bayesian Optimization
Tuning
Hyperparameter Optimization
Large search space, High evaluation cost
Optuna
Tuning
Next-gen Hyperparameter Optimization
Efficient, Define-by-run, Pruning capabilities
L1 (Lasso)
Regularization
Sparse Model, Feature Selection
When sparse solution is needed
L2 (Ridge)
Regularization
Prevent Overfitting, Weight Decay
When high multicollinearity exists
ElasticNet
Regularization
Combination of L1 and L2
When both feature selection and regularization needed
5. Interpretation
Methodology
Usage / Purpose
Notes
SHAP
Explain Model Predictions
Specialized for Tree-based models
Appendix: Evaluation Metrics Guide
Select metrics based on your problem type and business goal.
Classification Metrics
Metric
Focus
When to use
Accuracy
Overall Correctness
Balanced datasets only. Misleading for imbalanced data.
Precision
False Positive Reduction
When FP is costly (e.g., Spam Filter).
Recall
False Negative Reduction
When FN is critical (e.g., Cancer Diagnosis, Fraud).
F1 Score
Balance
When you need a balance between Precision and Recall.
ROC-AUC
Ranking Quality
When you need robust performance across thresholds.
Log Loss
Probability Confidence
When the predicted probability value itself matters.
Regression Metrics
Metric
Focus
When to use
MSE
Large Error Penalty
When outliers/large errors should be heavily penalized.
RMSE
Interpretability
When you need error in the same unit as the target.
MAE
Robustness
When you want to be robust against outliers.
R2 Score
Explainability
To see how much variance is explained by the model.
MAPE
Business Interpretability
Error in Percentage (%). Easy for stakeholders.
Clustering Metrics (Unsupervised)
Metric
Focus
When to use
Silhouette Score
Cluster Separation
To measure how similar an object is to its own cluster compared to other clusters.
Davies-Bouldin
Cluster Compactness
Lower is better. Good for comparing clustering algorithms.
Elbow Method
Optimal K
To find the inflection point (optimal K) in K-Means.
1---2name: data-analyst3description: Python 생태계(Jupyter, Pandas, Scikit-learn)를 활용하여 데이터에서 심층적인 인사이트를 도출하는 전문 분석 워크플로우입니다.4---56# Data Analyst Workflow78Python 생태계(Jupyter, Pandas, Scikit-learn)를 활용하여 데이터에서 심층적인 인사이트를 도출하는 전문 분석 워크플로우입니다. OSEMN 방법론과 `SKILL.md`의 표준을 따릅니다.910## 0단계: 기본 원칙 (Core Principles)11121. **Explanation First (선 설명 후 코드)**: 코드를 작성하기 전에 무엇을, 왜 분석하는지 Markdown으로 서술합니다.132. **Interpretation Mandatory (결과 해석 필수)**: 모든 코드 셀(Code Cell)의 출력 하단에는 반드시 **Markdown 셀**을 추가하여 통계적 수치나 그래프가 의미하는 바를 **한글로** 상세히 해석합니다.14 - *Bad*: 그래프만 덩그러니 있음.15 - *Good*: "히스토그램의 꼬리가 우측으로 긴 것으로 보아(Skewed > 1), 로그 변환이 필요함을 시사합니다."1617## 1단계: 분석 환경 및 목표 정의 (Environment & Goal)18191. **Context Loading**:20 - `this document`를 로드하여 **'Core Principles'**를 확인합니다.21 - **Methodology Screening (방법론 스크리닝)**:22 - `SKILL.md`의 **'Methodology Master List'**를 스캔합니다.23 - 현재 데이터셋의 특성(Type, Shape, Quality)과 분석 목표(Goal)를 대조하여 후보군(Candidates)을 3개 이상 필터링합니다.24 - **[Check]**: 각 후보군 선정 이유를 한 줄로 서술하였는가? (예: "결측치가 많으므로 Random Forest 채택")252. **Define Objective**:26 - `resources/plan-template.md`를 사용하여 `docs/plans/ANALYSIS_[주제].md`를 작성합니다.27 - 단순 통계/정확도 외에 **비즈니스 임팩트(KPI)**를 성공 지표로 정의합니다.283. **Notebook Setup**:29 - `docs/notebooks/[Topic]_Analysis.ipynb`를 생성하거나 엽니다.30 - **AI Readability**: 모든 통계량(`describe`, `p-value`)과 그래프는 노트북 출력 셀에 남겨두어야 합니다 (No Hiding).3132## 3단계: 방법론 스크리닝 (Methodology Screening)33**"The Right Tool for the Job"**3435데이터 특성에 맞춰 `SKILL.md`의 **Methodology Master List**에서 최적의 기법을 선정하고 **Plan에 명시**합니다.3637* **Metric Selection**: 비즈니스 목표와 데이터 불균형 여부에 따라 평가지표를 선택합니다. (예: Imbalanced → F1/Recall/PRCURSOR, Regression → MAPE/RMSE)38* **Preprocessing**: 39 * **Outliers**: 이상치가 많으면 `RobustScaler` 선택.40 * **High Cardinality**: 카테고리가 너무 많으면 `Target Encoding` 고려.41 * **Imbalance**: `SMOTE` 또는 `Class Weights` 적용 여부 결정.42* **Modeling**: 43 * **Baseline**: Logistic/Linear Regression, Decision Tree.44 * **Advanced**: `CatBoost`(Categorical), `XGBoost/LightGBM`(Large Data), `Isolation Forest`(Anomaly) 등 선택.45* **Validation стратегия**:46 * **Time Series**: 반드시 `Time Series Split` 사용.47 * **Imbalanced**: `Stratified K-Fold` 필수.4849## 2단계: 데이터 적재 및 품질 검증 (Obtain & Scrub)5051Garbage In, Garbage Out을 방지하기 위한 데이터 신뢰성 확보 단계입니다.52531. **Smart Loading**:54 - **Excel**: 수식(Formula) 보존이 필요하면 `openpyxl`을 사용하고, 계산된 값(Calculated Values)을 **하드코딩(Hardcoding)하지 않도록** 주의합니다.55 - **CSV**: 인코딩(`utf-8`, `cp949`) 및 구분자(Delimiter) 자동 감지 기능을 활용합니다.562. **Data Profiling**:57 - 기초 통계량(`describe()`), 결측치(`isnull().sum()`), 데이터 타입(`dtypes`)을 확인합니다.58 - **[Markdown]**: 확인된 결측치 현황과 데이터 타입을 텍스트로 요약합니다.593. **Deep Sanity Check**:60 - `SKILL.md`의 **'Logical Failures'** 항목을 참조하여 정밀 점검합니다.61 - **불가능한 값 감지**: 음수 나이(Age < 0), 미래의 날짜(Future Dates) 등 상식 밖의 데이터를 식별합니다.624. **Strategic Cleaning**:63 - 결측치 및 이상치 처리 시, 앞서 스크리닝한 **'Imputation Methodology'** (Simple, KNN, Iterative)를 적용합니다.64 - 처리 기준(삭제 vs 대치)과 근거를 명시합니다.6566## 3단계: 가설 주도적 탐색 (Hypothesis Driven EDA)6768단순한 그래프 나열을 지양하고, 질문(Question) -> 시각화(Viz) -> 발견(Finding)의 흐름을 유지합니다.69701. **Univariate Analysis**: 개별 변수의 분포, 왜도(Skewness), 첨도(Kurtosis)를 확인합니다.71 - **[Markdown]**: 각 변수의 분포 특성과 이상치 유무를 서술합니다.722. **Bivariate Analysis**: 상관관계 행렬(Correlation Matrix), 산점도(Scatter)를 통해 변수 간 관계를 시각화합니다.73 - **[Markdown]**: 변수 간의 선형/비선형 관계를 해석합니다.743. **Statistical Validation**:75 - 시각적 발견을 통계적 검정(Normality Test, T-test, ANOVA)으로 검증하여 '우연'이 아님을 증명합니다.76 - **[Markdown]**: p-value를 근거로 귀무가설 기각 여부를 명시합니다.774. **Insight Logging**:78 - 분석 중간에 발견된 중요한 사실이 비즈니스 KPI에 미칠 영향을 즉시 기록합니다.7980## 4단계: 모델링 및 해석 (Model & Interpret) [Optional]81821. **Baseline Model**:83 - 가장 간단한 모델(Dummy, Linear)로 성능 하한선(Baseline)을 설정하고 이를 넘어서는지 확인합니다.842. **Feature Engineering**:85 - `SKILL.md` 리스트의 기법(Encoding, Scaling, PCA)을 적용합니다.863. ### 4.3 Advanced Modeling & Tuning87* **Model Selection**: 선정된 고성능 모델(XGBoost, CatBoost, RF 등)을 학습합니다.88* **Hyperparameter Tuning**: 단순히 Grid Search를 넘어 `Optuna` 등을 활용해 효율적으로 최적화합니다.89* **Rigorous Validation**: `Cross Validation` 점수와 `Hold-out Test` 점수의 차이를 확인하여 오버피팅을 감지합니다. (Gap > 5% 시 경고)90 - **Clustering**: K-Means 등을 사용할 경우 `Elbow Method`나 `Silhouette Score`로 최적의 군집 수(K)를 결정합니다.914. **Rigorous Validation**:92 - **Stratified K-Fold**를 사용하여 과적합을 방지하고 일반화 성능을 평가합니다.935. **Interpretation & Error Analysis**:94 - **Feature Importance**: `SHAP`, `Permutation Importance` 등을 활용해 모델의 판단 근거를 설명합니다.95 - **Error Analysis**: **'Top 10 Worst Errors'** (모델이 가장 크게 틀린 샘플 10개)를 수동으로 검사하여 원인을 파악합니다.966. **Reporting**:97 - 기술적 수치(Accuracy, MSE)를 **비즈니스 언어**(예상 수익, 리스크 감소)로 번역하여 보고합니다.9899100---101102## Standards & Rules103104# Data Analyst Standards (OSEMN)105106## Purpose107To transform raw data into actionable business insights using a rigorous, hypothesis-driven approach.108109## Core Principles (Core Philosophy)110**"No Hiding"**111**AI Readability**: All statistical outputs (`describe`, `corr`, `p-value`) and graphs must remain in the notebook output. This ensures tools like NotebookLM can contextually understand the analysis.112113## Quality Standards (Tier 1 Best Practices)114115### 1. Data Integrity (Obtain & Scrub)116**"Garbage In, Garbage Out"**117- [ ] **Data Source Verification**: Check file extension, size, and metadata.118- [ ] **Data Quality Check**:119 - **Missing Values**: Identify mechanism (MCAR, MAR, MNAR) before imputing.120 - **Logical Failures**: Check for impossible values (e.g., age < 0, future dates), Data Leakage, and Overfitting indicators.121 - **Data Types**: Ensure numeric cols are not strings, etc.122- [ ] **File Handling Standards**:123 - **Excel (.xlsx)**: Preserve existing formatting/formulas. Use `openpyxl` for editing, `pandas` for reading. **Zero Hardcoding** of calculated values.124 - **CSV (.csv)**: Detect delimiter automatically (`csv.Sniffer`). Handle encoding errors (utf-8 vs cp949) explicitly.125126### 2. Hypothesis Driven EDA (Explore)127**"Ask, Don't just Plot"**128- [ ] **Univariate Analysis**: Distribution of *each* key variable (Histogram/Boxplot). Check for Skewness/Kurtosis.129- [ ] **Bivariate Analysis**: Correlation matrix, Scatter plots for relationships.130- [ ] **Statistical Validation**:131 - **Normality Test**: Shapiro-Wilk or K-S test.132 - **Significance**: T-test/ANOVA for group differences.133- [ ] **Insight Logging**: Record the implication of every finding immediately.134135### 3. Rigorous Modeling (Model)136**"Trust but Verify"**137- [ ] **Baseline First**: Compare complex models against a Dummy/Logistic Baseline.138- [ ] **Feature Engineering**: Scale numericals, Encode categoricals, Create interaction terms.139- [ ] **Cross-Validation**: Use Stratified K-Fold to prevent overfitting.140- [ ] **Metric Selection**: Optimize for business KPI (not just Accuracy).141- [ ] **Methodology Screening**: Consult the **Methodology Master List** (below) to select appropriate algorithms.142143### 4. Interpretation (Interpret)144**"Why did it predict that?"**145- [ ] **Feature Importance**: SHAP values or Permutation Importance.146- [ ] **Error Analysis**: Manually inspect the "Top 10 Worst Errors".147- [ ] **Actionable Conclusion**: Translate stats into business recommendations.148149## Checklist (Quality Gate)150Before finalizing:151- [ ] **Reproducibility**: Can the notebook run from top to bottom without error?152- [ ] **Storytelling**: Does the notebook flow like a narrative?153- [ ] **Visuals**: Are all graphs labeled (Title, Axis, Legend)?154155## Appendix: Methodology Master List (Reference)156157Scan these tables to select the most appropriate methodology for your data and goal.158159### 1. Preprocessing & Data Cleaning160| Methodology | Usage / Purpose | Data Constraints |161| :----------------------- | :-------------------------------------------------- | :---------------------------------------------------- |162| **Simple Imputation** | Missing Value Imputation (Simple Replacement) | Mean/Median (Numeric), Mode (Categorical) |163| **KNN Imputation** | Missing Value Imputation (Similarity-based) | Mainly Numeric, useful when correlations exist |164| **Iterative Imputation** | Missing Value Imputation (Model-based) | High variable correlation, assumes MAR |165| **One-Hot Encoding** | Categorical to Numeric | Nominal data, Low Cardinality |166| **Label Encoding** | Categorical to Numeric | Ordinal data |167| **Target Encoding** | Categorical to Numeric | High Cardinality features, Risk of Overfitting |168| **Standard Scaler** | Scaling (Standardization) | Sensitive to outliers, assumes Gaussian distribution |169| **MinMax Scaler** | Scaling (Normalization) | Bounded data, distribution agnostic |170| **Robust Scaler** | Scaling (Robust to Outliers) | Data with many outliers (Uses Median/IQR) |171| **SMOTE** | Oversampling (Imbalanced Data) | Synthesize minority class samples (Training set ONLY) |172| **PCA** | Dimensionality Reduction, Multicollinearity Removal | Continuous variables, assumes linear relationships |173174### 2. Machine Learning Models175| Methodology | Type | Usage / Purpose | Constraints / Notes |176| :---------------------- | :---------------- | :----------------------------------------- | :--------------------------------------------------------- |177| **Linear Regression** | Regression | Baseline for regression | Linear relationship assumption |178| **Logistic Regression** | Classification | Baseline for classification | Linear separation assumption, large sparse data OK |179| **SVM / SVR** | Class/Reg | High accuracy in high dimensional spaces | Computationally expensive (O(n^3)), Scale-sensitive |180| **K-Nearest Neighbors** | Class/Reg | Instance-based learning, Simple | Scale-sensitive, Small data |181| **Random Forest** | Ensemble | Robust Classification/Regression | Handles Mixed types, Robust to outliers/missing values |182| **XGBoost / LightGBM** | Ensemble | High Performance | Large datasets, handles missing values internally |183| **CatBoost** | Ensemble | Best for Categorical Features | Handles categories automatically, Slower training |184| **Isolation Forest** | Anomaly Detection | Outlier/Anomaly Detection | High dimensional data, efficiency |185| **K-Means** | Clustering | Partitioning into K clusters | Spherical Clusters, Sensitive to outliers, Scale-sensitive |186| **DBSCAN** | Clustering | Density-based clustering, Detects Outliers | Arbitrary shapes, Scale-sensitive, finding epsilon is hard |187| **Hierarchical** | Clustering | Dendrogram visualization | Computationally expensive for large data |188189### 3. Deep Learning Models190| Methodology | Usage / Purpose | Data Constraints |191| :-------------- | :------------------------------ | :------------------------------- |192| **CNN** | Image/Pattern Recognition | Grid-like data (Images, etc.) |193| **RNN / LSTM** | Sequence/Time-Series Prediction | Sequential data |194| **Transformer** | NLP, Complex Pattern Matching | Long sequences, Large-scale data |195196### 4. Validation & Optimization197| Methodology | Type | Usage / Purpose | Notes |198| :------------------------ | :------------- | :----------------------------------- | :---------------------------------------------------- |199| **Stratified K-Fold** | Validation | Cross Validation (Generalization) | Essential for Imbalanced Class distribution |200| **K-Fold CV** | Validation | Cross Validation | Sufficient data, Balanced classes |201| **Time Series Split** | Validation | Cross Validation (Temporal) | No future data leakage (essential for time-series) |202| **Grid Search** | Tuning | Hyperparameter Optimization | Small search space (Exhaustive) |203| **Bayesian Optimization** | Tuning | Hyperparameter Optimization | Large search space, High evaluation cost |204| **Optuna** | Tuning | Next-gen Hyperparameter Optimization | Efficient, Define-by-run, Pruning capabilities |205| **L1 (Lasso)** | Regularization | Sparse Model, Feature Selection | When sparse solution is needed |206| **L2 (Ridge)** | Regularization | Prevent Overfitting, Weight Decay | When high multicollinearity exists |207| **ElasticNet** | Regularization | Combination of L1 and L2 | When both feature selection and regularization needed |208209### 5. Interpretation210| Methodology | Usage / Purpose | Notes |211| :---------- | :------------------------ | :-------------------------------- |212| **SHAP** | Explain Model Predictions | Specialized for Tree-based models |213214## Appendix: Evaluation Metrics Guide215216Select metrics based on your problem type and business goal.217218### Classification Metrics219| Metric | Focus | When to use |220| :------------ | :----------------------- | :------------------------------------------------------ |221| **Accuracy** | Overall Correctness | Balanced datasets only. Misleading for imbalanced data. |222| **Precision** | False Positive Reduction | When FP is costly (e.g., Spam Filter). |223| **Recall** | False Negative Reduction | When FN is critical (e.g., Cancer Diagnosis, Fraud). |224| **F1 Score** | Balance | When you need a balance between Precision and Recall. |225| **ROC-AUC** | Ranking Quality | When you need robust performance across thresholds. |226| **Log Loss** | Probability Confidence | When the predicted probability value itself matters. |227228### Regression Metrics229| Metric | Focus | When to use |230| :----------- | :------------------------ | :------------------------------------------------------ |231| **MSE** | Large Error Penalty | When outliers/large errors should be heavily penalized. |232| **RMSE** | Interpretability | When you need error in the same unit as the target. |233| **MAE** | Robustness | When you want to be robust against outliers. |234| **R2 Score** | Explainability | To see how much variance is explained by the model. |235| **MAPE** | Business Interpretability | Error in Percentage (%). Easy for stakeholders. |236237### Clustering Metrics (Unsupervised)238| Metric | Focus | When to use |239| :------------------- | :------------------ | :--------------------------------------------------------------------------------- |240| **Silhouette Score** | Cluster Separation | To measure how similar an object is to its own cluster compared to other clusters. |241| **Davies-Bouldin** | Cluster Compactness | Lower is better. Good for comparing clustering algorithms. |242| **Elbow Method** | Optimal K | To find the inflection point (optimal K) in K-Means. |
Run npx skillmds@latest add lastdays03/data-analyst in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Python 생태계(Jupyter, Pandas, Scikit-learn)를 활용하여 데이터에서 심층적인 인사이트를 도출하는 전문 분석 워크플로우입니다. It is listed under Data & Analytics on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
lastdays03 (@lastdays03) published this skill. Their other Agent Skills are listed on their SkillMD profile.