d8a80f6272
이름만 다른(표기 변형) [[위키링크]]를 대상 문서의 canonical 제목으로 치환해 끊겼던 1,200개 링크를 연결. 제목/파일명 정규화 일치만 적용하고 별칭 매칭은 과병합 위험으로 제외(애매성 가드). 원본은 _link_reconcile_backup/ 에 백업. 도구: Datacollect/scripts/link_reconcile_apply.mjs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
175 lines
5.6 KiB
Markdown
175 lines
5.6 KiB
Markdown
---
|
|
id: wiki-2026-0508-analysis
|
|
title: Analysis
|
|
category: 10_Wiki/Topics
|
|
status: verified
|
|
canonical_id: self
|
|
aliases: [Data Analysis, Analytical Method]
|
|
duplicate_of: none
|
|
source_trust_level: A
|
|
confidence_score: 0.9
|
|
verification_status: applied
|
|
tags: [analysis, methodology, reasoning]
|
|
raw_sources: []
|
|
last_reinforced: 2026-05-10
|
|
github_commit: pending
|
|
tech_stack:
|
|
language: python
|
|
framework: pandas
|
|
---
|
|
|
|
# Analysis
|
|
|
|
## 매 한 줄
|
|
> **"매 Analysis는 복잡한 whole를 component parts로 decompose하여 underlying structure를 understand하는 systematic process이다"**. Aristotle의 logical decomposition에서 시작하여, modern data science(2026)에서는 EDA, statistical inference, causal analysis까지 spectrum이 확장되었다. 매 핵심은 reduction 자체가 아니라, decomposition 후의 synthesis로 actionable insight를 도출하는 것.
|
|
|
|
## 매 핵심
|
|
|
|
### 매 Analysis vs Synthesis
|
|
- **Analysis**: top-down decomposition — whole → parts → relationships.
|
|
- **Synthesis**: bottom-up integration — parts → whole.
|
|
- 매 둘은 paired operation — analysis만 하면 fragmentation, synthesis만 하면 superficial generalization.
|
|
|
|
### 매 분석 dimensions
|
|
- **Descriptive**: "무엇이 happened?" — summary statistics, distributions.
|
|
- **Diagnostic**: "왜 happened?" — correlation, causal inference.
|
|
- **Predictive**: "무엇이 happen할 것인가?" — forecasting models.
|
|
- **Prescriptive**: "무엇을 해야 하나?" — optimization, decision theory.
|
|
|
|
### 매 응용
|
|
1. EDA (Exploratory Data Analysis) — Tukey의 1977 framework, 매 modern DS의 first step.
|
|
2. Root Cause Analysis — 5 Whys, fishbone, fault tree.
|
|
3. Sensitivity Analysis — input perturbation으로 model robustness 측정.
|
|
4. Failure Mode Analysis (FMEA) — engineering risk assessment.
|
|
|
|
## 💻 패턴
|
|
|
|
### EDA quickstart (Polars 2026)
|
|
```python
|
|
import polars as pl
|
|
import matplotlib.pyplot as plt
|
|
|
|
df = pl.read_parquet("data.parquet")
|
|
print(df.schema)
|
|
print(df.null_count())
|
|
print(df.describe())
|
|
|
|
for col in df.select(pl.col(pl.NUMERIC_DTYPES)).columns:
|
|
df[col].to_pandas().hist(bins=50)
|
|
plt.title(col); plt.show()
|
|
```
|
|
|
|
### Correlation matrix with significance
|
|
```python
|
|
import numpy as np
|
|
from scipy import stats
|
|
|
|
def corr_with_pvalues(df):
|
|
cols = df.select_dtypes(include=np.number).columns
|
|
n = len(cols)
|
|
corr = np.zeros((n, n)); pval = np.zeros((n, n))
|
|
for i, a in enumerate(cols):
|
|
for j, b in enumerate(cols):
|
|
r, p = stats.pearsonr(df[a].dropna(), df[b].dropna())
|
|
corr[i, j] = r; pval[i, j] = p
|
|
return corr, pval
|
|
```
|
|
|
|
### Causal analysis (DoWhy 2026)
|
|
```python
|
|
from dowhy import CausalModel
|
|
|
|
model = CausalModel(
|
|
data=df,
|
|
treatment="ad_spend",
|
|
outcome="revenue",
|
|
common_causes=["season", "channel", "brand"],
|
|
)
|
|
identified = model.identify_effect()
|
|
estimate = model.estimate_effect(
|
|
identified, method_name="backdoor.linear_regression"
|
|
)
|
|
refute = model.refute_estimate(
|
|
identified, estimate, method_name="random_common_cause"
|
|
)
|
|
print(estimate.value, refute)
|
|
```
|
|
|
|
### Sensitivity analysis (SALib)
|
|
```python
|
|
from SALib.sample import sobol
|
|
from SALib.analyze import sobol as sobol_analyze
|
|
|
|
problem = {
|
|
"num_vars": 3,
|
|
"names": ["x1", "x2", "x3"],
|
|
"bounds": [[0, 1]] * 3,
|
|
}
|
|
X = sobol.sample(problem, 1024)
|
|
Y = np.array([model_fn(*x) for x in X])
|
|
Si = sobol_analyze.analyze(problem, Y)
|
|
print(Si["S1"], Si["ST"])
|
|
```
|
|
|
|
### Failure Mode tabulation
|
|
```python
|
|
fmea = pl.DataFrame({
|
|
"mode": ["timeout", "OOM", "race"],
|
|
"severity": [7, 9, 8],
|
|
"occurrence": [4, 2, 3],
|
|
"detection": [5, 6, 9],
|
|
})
|
|
fmea = fmea.with_columns(
|
|
(pl.col("severity") * pl.col("occurrence") * pl.col("detection")).alias("RPN")
|
|
).sort("RPN", descending=True)
|
|
```
|
|
|
|
### LLM-assisted analysis (Claude Opus 4.7)
|
|
```python
|
|
from anthropic import Anthropic
|
|
|
|
client = Anthropic()
|
|
resp = client.messages.create(
|
|
model="claude-opus-4-7",
|
|
max_tokens=2048,
|
|
system="You are a senior data analyst. Output JSON: {findings, hypotheses, next_steps}.",
|
|
messages=[{"role": "user", "content": f"Summary stats:\n{df.describe()}"}],
|
|
)
|
|
```
|
|
|
|
## 매 결정 기준
|
|
| 상황 | Approach |
|
|
|---|---|
|
|
| New dataset, no prior | EDA + descriptive |
|
|
| Known outcome, want drivers | Diagnostic + causal |
|
|
| Need forecast | Predictive ML |
|
|
| Decision under uncertainty | Prescriptive + sensitivity |
|
|
| Post-incident | Root cause + FMEA |
|
|
|
|
**기본값**: EDA first — 매 어떤 sophisticated method도 raw data 의 distribution 의 understanding 없이는 misleading하다.
|
|
|
|
## 🔗 Graph
|
|
- 부모: [[Scientific Method]]
|
|
- 변형: [[Exploratory Data Analysis (EDA)]] · [[Causal Inference]] · [[Root Cause Analysis]]
|
|
- 응용: [[Decision Making]] · [[Debugging]]
|
|
- Adjacent: [[Synthesis]] · [[Statistics]]
|
|
|
|
## 🤖 LLM 활용
|
|
**언제**: hypothesis generation, summary narration, code scaffolding for analysis pipelines, anomaly explanation.
|
|
**언제 X**: precise statistical inference (use proper tools), causal claims without proper identification, large-N numeric crunching (use pandas/polars not LLM).
|
|
|
|
## ❌ 안티패턴
|
|
- **Analysis paralysis**: 매 endless decomposition without synthesis — 의 decision 의 deferred.
|
|
- **Confirmation bias**: 매 only analyzing data that supports prior hypothesis.
|
|
- **Spurious correlation**: 매 correlation을 causation으로 confuse.
|
|
- **Over-decomposition**: 매 component-level optimization 의 global suboptimum.
|
|
|
|
## 🧪 검증 / 중복
|
|
- Verified (Tukey 1977 *Exploratory Data Analysis*; Pearl 2009 *Causality*).
|
|
- 신뢰도 A.
|
|
|
|
## 🕓 Changelog
|
|
| 날짜 | 변경 |
|
|
|---|---|
|
|
| 2026-05-08 | Phase 1 |
|
|
| 2026-05-10 | Manual cleanup — full content with 6 patterns + decision matrix | |