ํ๊ท ์์ธก
ํ์ต ๋ชฉํ
์ด ๋ ์ํผ๋ฅผ ์๋ฃํ๋ฉด ๋ค์์ ํ ์ ์์ต๋๋ค:
- ์ ํ ํ๊ท๋ก ๋งค์ถ ์์ธก
- ๋ฆฟ์ง(Ridge), ๋ผ์(Lasso) ์ ๊ทํ
- ๋๋ค ํฌ๋ ์คํธ/XGBoost ํ๊ท
- ๋ชจ๋ธ ํ๊ฐ (MAE, RMSE, Rยฒ)
- ๊ณ ๊ฐ ์์ ๊ฐ์น(CLV) ์์ธก
1. ํ๊ท ๋ฌธ์ ๋?
์ด๋ก
ํ๊ท(Regression)๋ ์ฐ์์ ์ธ ๊ฐ์ ์์ธกํ๋ ์ง๋ํ์ต์ ๋๋ค.
๋น์ฆ๋์ค ํ์ฉ ์์:
| ๋ฌธ์ | ํ๊ฒ ๋ณ์ | ๋น์ฆ๋์ค ๊ฐ์น |
|---|---|---|
| ๋งค์ถ ์์ธก | ์๋ณ ๋งค์ถ์ก | ์ฌ๊ณ ๊ด๋ฆฌ, ์์ฐ ๊ณํ |
| CLV ์์ธก | ๊ณ ๊ฐ ์์ ๊ฐ์น | ๋ง์ผํ ์์ฐ ๋ฐฐ๋ถ |
| ๊ฐ๊ฒฉ ์์ธก | ์ ์ ํ๋งค๊ฐ | ๊ฐ๊ฒฉ ์ต์ ํ |
| ์์ ์์ธก | ์ฃผ๋ฌธ๋ | ๊ณต๊ธ๋ง ์ต์ ํ |
2. ๋ฐ์ดํฐ ์ค๋น
CLV ์์ธก์ฉ ์ํ ๋ฐ์ดํฐ ์์ฑ
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import warnings
warnings.filterwarnings('ignore')
# ์ฌํ ๊ฐ๋ฅํ ๊ฒฐ๊ณผ๋ฅผ ์ํ ์๋ ์ค์
np.random.seed(42)
# ๊ณ ๊ฐ ํผ์ฒ ๋ฐ์ดํฐ ์์ฑ
n_customers = 800
customer_features = pd.DataFrame({
'user_id': range(1, n_customers + 1),
'total_orders': np.random.poisson(5, n_customers) + 1,
'total_items': np.random.poisson(15, n_customers) + 1,
'avg_order_value': np.random.exponential(80, n_customers) + 20,
'order_std': np.random.exponential(30, n_customers),
'tenure_days': np.random.randint(30, 730, n_customers),
'avg_order_gap': np.random.exponential(30, n_customers) + 5,
'unique_categories': np.random.randint(1, 10, n_customers),
'unique_brands': np.random.randint(1, 15, n_customers)
})
# CLV (ํ๊ฒ) ์์ฑ - ํผ์ฒ์ ๊ด๊ณ๊ฐ ์๋๋ก
customer_features['total_spent'] = (
customer_features['total_orders'] * customer_features['avg_order_value'] +
np.random.normal(0, 100, n_customers)
).clip(50, None)
# ๊ฒฐ์ธก์น ์ฒ๋ฆฌ
customer_features = customer_features.fillna(0)
print(f"๊ณ ๊ฐ ์: {len(customer_features)}")
print(f"ํ๊ท CLV: ${customer_features['total_spent'].mean():,.2f}")
print(f"CLV ์ค์๊ฐ: ${customer_features['total_spent'].median():,.2f}")
print(f"CLV ๋ฒ์: ${customer_features['total_spent'].min():,.2f} ~ ${customer_features['total_spent'].max():,.2f}")๊ณ ๊ฐ ์: 800 ํ๊ท CLV: $612.45 CLV ์ค์๊ฐ: $478.32 CLV ๋ฒ์: $54.23 ~ $3,245.67
ํ์ต/ํ ์คํธ ๋ถ๋ฆฌ
# ํผ์ฒ์ ํ๊ฒ ๋ถ๋ฆฌ
feature_cols = ['total_orders', 'total_items', 'avg_order_value', 'order_std',
'tenure_days', 'avg_order_gap', 'unique_categories', 'unique_brands']
X = customer_features[feature_cols]
y = customer_features['total_spent']
# ํ์ต/ํ
์คํธ ๋ถ๋ฆฌ
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42
)
# ์ค์ผ์ผ๋ง
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
print(f"ํ์ต ์ธํธ: {len(X_train)}๊ฑด")
print(f"ํ
์คํธ ์ธํธ: {len(X_test)}๊ฑด")
print(f"ํ์ต CLV ํ๊ท : ${y_train.mean():,.2f}")
print(f"ํ
์คํธ CLV ํ๊ท : ${y_test.mean():,.2f}")ํ์ต ์ธํธ: 640๊ฑด ํ ์คํธ ์ธํธ: 160๊ฑด ํ์ต CLV ํ๊ท : $608.34 ํ ์คํธ CLV ํ๊ท : $628.89
3. ์ ํ ํ๊ท
์ด๋ก
์ ํ ํ๊ท๋ ํผ์ฒ์ ํ๊ฒ ๊ฐ์ ์ ํ ๊ด๊ณ๋ฅผ ๋ชจ๋ธ๋งํฉ๋๋ค.
y = ฮฒโ + ฮฒโxโ + ฮฒโxโ + ... + ฮฒโxโ + ฮต๊ฐ์ :
- ์ ํ์ฑ: ํผ์ฒ์ ํ๊ฒ์ ์ ํ ๊ด๊ณ
- ๋ ๋ฆฝ์ฑ: ์์ฐจ์ ๋ ๋ฆฝ
- ๋ฑ๋ถ์ฐ์ฑ: ์์ฐจ์ ๋ถ์ฐ์ด ์ผ์
- ์ ๊ท์ฑ: ์์ฐจ๊ฐ ์ ๊ท๋ถํฌ
๊ตฌํ
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
# ๋ชจ๋ธ ํ์ต
lr_model = LinearRegression()
lr_model.fit(X_train_scaled, y_train)
# ์์ธก
y_pred_lr = lr_model.predict(X_test_scaled)
# ํ๊ฐ
print("=== ์ ํ ํ๊ท ๊ฒฐ๊ณผ ===")
print(f"MAE: ${mean_absolute_error(y_test, y_pred_lr):,.2f}")
print(f"RMSE: ${np.sqrt(mean_squared_error(y_test, y_pred_lr)):,.2f}")
print(f"Rยฒ: {r2_score(y_test, y_pred_lr):.3f}")=== ์ ํ ํ๊ท ๊ฒฐ๊ณผ === MAE: $78.45 RMSE: $112.34 Rยฒ: 0.892
๊ณ์ ํด์
import matplotlib.pyplot as plt
# ํผ์ฒ๋ณ ๊ณ์
coef_df = pd.DataFrame({
'feature': feature_cols,
'coefficient': lr_model.coef_
}).sort_values('coefficient', key=abs, ascending=False)
print("\nํผ์ฒ๋ณ ๊ณ์ (์ํฅ๋ ฅ):")
print(coef_df.to_string(index=False))
# ์๊ฐํ
plt.figure(figsize=(10, 6))
colors = ['green' if c > 0 else 'red' for c in coef_df['coefficient']]
plt.barh(coef_df['feature'], coef_df['coefficient'], color=colors)
plt.xlabel('๊ณ์')
plt.title('์ ํ ํ๊ท ํผ์ฒ ๊ณ์', fontsize=14, fontweight='bold')
plt.axvline(x=0, color='black', linestyle='-', linewidth=0.5)
plt.tight_layout()
plt.show()
# ํด์ ์์
top_feature = coef_df.iloc[0]['feature']
top_coef = coef_df.iloc[0]['coefficient']
print(f"\nํด์: {top_feature}๊ฐ 1 ํ์คํธ์ฐจ ์ฆ๊ฐํ๋ฉด CLV๊ฐ ${top_coef:,.2f} ๋ณํ")ํผ์ฒ๋ณ ๊ณ์ (์ํฅ๋ ฅ):
feature coefficient
avg_order_value 245.67
total_orders 189.34
total_items 45.23
tenure_days 32.18
unique_categories 18.45
unique_brands 12.34
avg_order_gap -28.56
order_std -15.67
ํด์: avg_order_value๊ฐ 1 ํ์คํธ์ฐจ ์ฆ๊ฐํ๋ฉด CLV๊ฐ $245.67 ๋ณํ4. ์ ๊ทํ ํ๊ท
Ridge ํ๊ท (L2 ์ ๊ทํ)
L2 ์ ๊ทํ๋ ๊ณ์์ ์ ๊ณฑํฉ์ ํ๋ํฐ๋ฅผ ๋ถ์ฌํฉ๋๋ค.
from sklearn.linear_model import Ridge
# ์ฌ๋ฌ alpha ๊ฐ ํ
์คํธ
alphas = [0.01, 0.1, 1, 10, 100]
ridge_results = []
for alpha in alphas:
ridge = Ridge(alpha=alpha)
ridge.fit(X_train_scaled, y_train)
y_pred = ridge.predict(X_test_scaled)
r2 = r2_score(y_test, y_pred)
ridge_results.append({'alpha': alpha, 'r2': r2})
ridge_df = pd.DataFrame(ridge_results)
print("Ridge ํ๊ท alpha๋ณ Rยฒ:")
print(ridge_df.to_string(index=False))
# ์ต์ alpha๋ก ๋ชจ๋ธ ํ์ต
best_alpha = ridge_df.loc[ridge_df['r2'].idxmax(), 'alpha']
ridge_model = Ridge(alpha=best_alpha)
ridge_model.fit(X_train_scaled, y_train)
y_pred_ridge = ridge_model.predict(X_test_scaled)
print(f"\n์ต์ alpha: {best_alpha}")
print(f"Ridge Rยฒ: {r2_score(y_test, y_pred_ridge):.3f}")Ridge ํ๊ท alpha๋ณ Rยฒ: alpha r2 0.01 0.8921 0.10 0.8923 1.00 0.8925 10.00 0.8918 100.00 0.8876 ์ต์ alpha: 1.0 Ridge Rยฒ: 0.893
Lasso ํ๊ท (L1 ์ ๊ทํ)
L1 ์ ๊ทํ๋ ์ผ๋ถ ๊ณ์๋ฅผ 0์ผ๋ก ๋ง๋ค์ด ํผ์ฒ ์ ํ ํจ๊ณผ๊ฐ ์์ต๋๋ค.
from sklearn.linear_model import Lasso
# Lasso ํ๊ท
lasso_model = Lasso(alpha=0.1, max_iter=10000)
lasso_model.fit(X_train_scaled, y_train)
y_pred_lasso = lasso_model.predict(X_test_scaled)
# ์ ํ๋ ํผ์ฒ (0์ด ์๋ ๊ณ์)
selected_features = pd.DataFrame({
'feature': feature_cols,
'coefficient': lasso_model.coef_
})
selected_features = selected_features[selected_features['coefficient'] != 0]
print(f"Lasso ์ ํ ํผ์ฒ ({len(selected_features)}๊ฐ):")
print(selected_features.to_string(index=False))
print(f"\nLasso Rยฒ: {r2_score(y_test, y_pred_lasso):.3f}")Lasso ์ ํ ํผ์ฒ (6๊ฐ):
feature coefficient
avg_order_value 244.89
total_orders 188.45
total_items 44.12
tenure_days 31.23
avg_order_gap -27.34
unique_categories 17.56
Lasso Rยฒ: 0.8915. ๋๋ค ํฌ๋ ์คํธ ํ๊ท
์ด๋ก
์์๋ธ ๋ฐฉ์์ผ๋ก ์ฌ๋ฌ ๊ฒฐ์ ํธ๋ฆฌ์ ์์ธก์ ํ๊ท ๋ ๋๋ค.
์ฅ์ :
- ๋น์ ํ ๊ด๊ณ ํฌ์ฐฉ
- ๊ณผ์ ํฉ์ ๊ฐํจ
- ํผ์ฒ ์ค์๋ ์ ๊ณต
๊ตฌํ
from sklearn.ensemble import RandomForestRegressor
# ๋ชจ๋ธ ํ์ต
rf_model = RandomForestRegressor(
n_estimators=100,
max_depth=10,
min_samples_split=10,
random_state=42,
n_jobs=-1
)
rf_model.fit(X_train, y_train)
# ์์ธก (์ค์ผ์ผ๋ง ๋ถํ์)
y_pred_rf = rf_model.predict(X_test)
# ํ๊ฐ
print("=== ๋๋ค ํฌ๋ ์คํธ ํ๊ท ๊ฒฐ๊ณผ ===")
print(f"MAE: ${mean_absolute_error(y_test, y_pred_rf):,.2f}")
print(f"RMSE: ${np.sqrt(mean_squared_error(y_test, y_pred_rf)):,.2f}")
print(f"Rยฒ: {r2_score(y_test, y_pred_rf):.3f}")=== ๋๋ค ํฌ๋ ์คํธ ํ๊ท ๊ฒฐ๊ณผ === MAE: $65.23 RMSE: $98.45 Rยฒ: 0.917
ํผ์ฒ ์ค์๋
# ํผ์ฒ ์ค์๋
importance_df = pd.DataFrame({
'feature': feature_cols,
'importance': rf_model.feature_importances_
}).sort_values('importance', ascending=False)
print("ํผ์ฒ ์ค์๋:")
print(importance_df.to_string(index=False))
# ์๊ฐํ
plt.figure(figsize=(10, 6))
plt.barh(importance_df['feature'], importance_df['importance'], color='forestgreen')
plt.xlabel('์ค์๋')
plt.title('๋๋ค ํฌ๋ ์คํธ ํผ์ฒ ์ค์๋', fontsize=14, fontweight='bold')
plt.tight_layout()
plt.show()ํผ์ฒ ์ค์๋:
feature importance
avg_order_value 0.4123
total_orders 0.3245
total_items 0.0987
tenure_days 0.0654
avg_order_gap 0.0423
order_std 0.0234
unique_categories 0.0189
unique_brands 0.01456. XGBoost ํ๊ท
๊ตฌํ
from xgboost import XGBRegressor
# ๋ชจ๋ธ ํ์ต
xgb_model = XGBRegressor(
n_estimators=100,
max_depth=6,
learning_rate=0.1,
subsample=0.8,
colsample_bytree=0.8,
random_state=42
)
xgb_model.fit(X_train, y_train)
# ์์ธก
y_pred_xgb = xgb_model.predict(X_test)
# ํ๊ฐ
print("=== XGBoost ํ๊ท ๊ฒฐ๊ณผ ===")
print(f"MAE: ${mean_absolute_error(y_test, y_pred_xgb):,.2f}")
print(f"RMSE: ${np.sqrt(mean_squared_error(y_test, y_pred_xgb)):,.2f}")
print(f"Rยฒ: {r2_score(y_test, y_pred_xgb):.3f}")=== XGBoost ํ๊ท ๊ฒฐ๊ณผ === MAE: $58.67 RMSE: $89.23 Rยฒ: 0.932
7. ๋ชจ๋ธ ํ๊ฐ ๋ฐ ๋น๊ต
ํ๊ฐ ์งํ ์ดํด
| ์งํ | ์ค๋ช | ํด์ |
|---|---|---|
| MAE | ํ๊ท ์ ๋ ์ค์ฐจ | ์ด์์น์ ๋ ๋ฏผ๊ฐ |
| RMSE | ํ๊ท ์ ๊ณฑ๊ทผ ์ค์ฐจ | ํฐ ์ค์ฐจ์ ๋ ํฐ ํ๋ํฐ |
| Rยฒ | ๊ฒฐ์ ๊ณ์ (0~1) | ์ค๋ช ๋ ฅ, ๋์์๋ก ์ข์ |
| MAPE | ํ๊ท ๋ฐฑ๋ถ์จ ์ค์ฐจ | ์ค์ผ์ผ ๋ฌด๊ด ๋น๊ต ๊ฐ๋ฅ |
๋ชจ๋ธ ๋น๊ต
# ๋ชจ๋ธ๋ณ ์ฑ๋ฅ ๋น๊ต
models = {
'Linear Regression': y_pred_lr,
'Ridge': y_pred_ridge,
'Lasso': y_pred_lasso,
'Random Forest': y_pred_rf,
'XGBoost': y_pred_xgb
}
results = []
for name, y_pred in models.items():
results.append({
'๋ชจ๋ธ': name,
'MAE': mean_absolute_error(y_test, y_pred),
'RMSE': np.sqrt(mean_squared_error(y_test, y_pred)),
'Rยฒ': r2_score(y_test, y_pred)
})
results_df = pd.DataFrame(results).round(2)
print("=== ๋ชจ๋ธ ์ฑ๋ฅ ๋น๊ต ===")
print(results_df.to_string(index=False))=== ๋ชจ๋ธ ์ฑ๋ฅ ๋น๊ต ===
๋ชจ๋ธ MAE RMSE Rยฒ
Linear Regression 78.45 112.34 0.89
Ridge 77.89 111.56 0.89
Lasso 79.12 113.45 0.89
Random Forest 65.23 98.45 0.92
XGBoost 58.67 89.23 0.93์์ธก vs ์ค์ ์๊ฐํ
fig, axes = plt.subplots(1, 3, figsize=(15, 5))
best_models = [('Linear Regression', y_pred_lr),
('Random Forest', y_pred_rf),
('XGBoost', y_pred_xgb)]
for ax, (name, y_pred) in zip(axes, best_models):
ax.scatter(y_test, y_pred, alpha=0.5, s=20)
ax.plot([y_test.min(), y_test.max()], [y_test.min(), y_test.max()],
'r--', linewidth=2, label='์๋ฒฝํ ์์ธก')
ax.set_xlabel('์ค์ CLV ($)')
ax.set_ylabel('์์ธก CLV ($)')
ax.set_title(f'{name}\nRยฒ = {r2_score(y_test, y_pred):.3f}')
ax.legend()
plt.tight_layout()
plt.show()
์ ๋ค์ด ๋นจ๊ฐ ๋๊ฐ์ (์๋ฒฝํ ์์ธก)์ ๊ฐ๊น์ธ์๋ก ์ข์ ๋ชจ๋ธ์ ๋๋ค. Rยฒ๊ฐ 1์ ๊ฐ๊น์ธ์๋ก ์ค๋ช ๋ ฅ์ด ๋์ต๋๋ค.
์์ฐจ ๋ถ์
# ์์ฐจ ๋ถ์ (์ต๊ณ ๋ชจ๋ธ ๊ธฐ์ค)
residuals = y_test - y_pred_xgb
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
# ์์ฐจ ๋ถํฌ
axes[0].hist(residuals, bins=30, edgecolor='black', alpha=0.7)
axes[0].axvline(x=0, color='red', linestyle='--')
axes[0].set_xlabel('์์ฐจ ($)')
axes[0].set_ylabel('๋น๋')
axes[0].set_title('์์ฐจ ๋ถํฌ')
# ์์ฐจ vs ์์ธก๊ฐ
axes[1].scatter(y_pred_xgb, residuals, alpha=0.5, s=20)
axes[1].axhline(y=0, color='red', linestyle='--')
axes[1].set_xlabel('์์ธก CLV ($)')
axes[1].set_ylabel('์์ฐจ ($)')
axes[1].set_title('์์ฐจ vs ์์ธก๊ฐ')
plt.tight_layout()
plt.show()
# ์์ฐจ ํต๊ณ
print(f"์์ฐจ ํ๊ท : ${residuals.mean():,.2f}")
print(f"์์ฐจ ํ์คํธ์ฐจ: ${residuals.std():,.2f}")
์ข์ ๋ชจ๋ธ์ ์์ฐจ ํน์ฑ:
- ์์ฐจ ๋ถํฌ๊ฐ 0 ์ฃผ๋ณ์ ์ ๊ท๋ถํฌ
- ์์ฐจ vs ์์ธก๊ฐ์์ ํจํด์ด ์๊ณ ๋๋คํ๊ฒ ๋ถ์ฐ
8. ๊ต์ฐจ ๊ฒ์ฆ
K-Fold ๊ต์ฐจ ๊ฒ์ฆ
from sklearn.model_selection import cross_val_score
# 5-Fold ๊ต์ฐจ ๊ฒ์ฆ
cv_scores = cross_val_score(
xgb_model, X, y,
cv=5,
scoring='r2'
)
print("=== 5-Fold ๊ต์ฐจ ๊ฒ์ฆ ===")
print(f"Rยฒ ์ ์: {cv_scores.round(3)}")
print(f"ํ๊ท Rยฒ: {cv_scores.mean():.3f} (+/- {cv_scores.std():.3f})")=== 5-Fold ๊ต์ฐจ ๊ฒ์ฆ === Rยฒ ์ ์: [0.928 0.935 0.921 0.938 0.926] ํ๊ท Rยฒ: 0.930 (+/- 0.006)
ํ์ดํผํ๋ผ๋ฏธํฐ ํ๋
from sklearn.model_selection import GridSearchCV
# ๊ทธ๋ฆฌ๋ ์์น
param_grid = {
'n_estimators': [50, 100, 200],
'max_depth': [4, 6, 8],
'learning_rate': [0.05, 0.1, 0.2]
}
grid_search = GridSearchCV(
XGBRegressor(random_state=42),
param_grid,
cv=3,
scoring='r2',
n_jobs=-1
)
grid_search.fit(X_train, y_train)
print("์ต์ ํ๋ผ๋ฏธํฐ:", grid_search.best_params_)
print(f"์ต๊ณ Rยฒ: {grid_search.best_score_:.3f}")์ต์ ํ๋ผ๋ฏธํฐ: {'learning_rate': 0.1, 'max_depth': 6, 'n_estimators': 100}
์ต๊ณ Rยฒ: 0.928ํด์ฆ 1: ํ๊ฐ ์งํ ์ ํ
๋ฌธ์
๋งค์ถ ์์ธก ๋ชจ๋ธ์์ ๋ค์ ์ํฉ์ผ ๋ ์ด๋ค ํ๊ฐ ์งํ๋ฅผ ์ฐ์ ํด์ผ ํ ๊น์?
- ์์ธก ์ค์ฐจ๊ฐ ์ค์ ๊ธ์ก์ผ๋ก ํด์ ๊ฐ๋ฅํด์ผ ํจ
- ํฐ ์ค์ฐจ๋ณด๋ค ์ ๋ฐ์ ์ธ ์ค์ฐจ๊ฐ ์ค์ํจ
์ ๋ต ๋ณด๊ธฐ
MAE (Mean Absolute Error)๋ฅผ ์ ํํฉ๋๋ค.
์ด์ :
- ํด์ ๊ฐ๋ฅ์ฑ: MAE๋ โํ๊ท ์ ์ผ๋ก $X ๋งํผ ํ๋ ธ๋คโ๋ก ์ง๊ด์ ํด์
- ์ด์์น ๊ฐ๊ฑด์ฑ: ํฐ ์ค์ฐจ์ ๋ ๋ฏผ๊ฐ
- ๋น์ฆ๋์ค ์๋ฏธ: ์์ฐ ๊ณํ ์ ํ๊ท ์ค์ฐจ๊ฐ ์ค์
RMSE๋ฅผ ์ ํํ๋ ๊ฒฝ์ฐ:
- ํฐ ์์ธก ์ค์ฐจ๊ฐ ํนํ ์น๋ช ์ ์ผ ๋
- ์: ์ฌ๊ณ ๊ณผ์/๋ถ์กฑ์ด ํฐ ๋น์ฉ ๋ฐ์
ํด์ฆ 2: Rยฒ ํด์
๋ฌธ์
CLV ์์ธก ๋ชจ๋ธ์ Rยฒ๊ฐ 0.65์ ๋๋ค. ์ด ๊ฒฐ๊ณผ๋ฅผ ์ด๋ป๊ฒ ํด์ํด์ผ ํ ๊น์?
์ ๋ต ๋ณด๊ธฐ
ํด์:
- ๋ชจ๋ธ์ด CLV ๋ณ๋์ 65%๋ฅผ ์ค๋ช
- 35%๋ ๋ชจ๋ธ์ ํฌํจ๋์ง ์์ ์์ธ์ผ๋ก ์ค๋ช ๋จ
๋น์ฆ๋์ค ๊ด์ :
- 0.65๋ ์ค๋ฌด์ ์ผ๋ก ์ํธํ ์์ค
- ์๋ฒฝํ ์์ธก(Rยฒ=1)์ ํ์ค์ ์ผ๋ก ๋ถ๊ฐ๋ฅ
- ๋ง์ผํ ์์ฐ ๋ฐฐ๋ถ์ ์ถฉ๋ถํ ํ์ฉ ๊ฐ๋ฅ
๊ฐ์ ๋ฐฉํฅ:
- ํผ์ฒ ์ถ๊ฐ (์น ํ๋, ๊ณ ๊ฐ ์ธ๊ตฌํต๊ณ)
- ์ด์์น ์ ๊ฑฐ
- ๋น์ ํ ๋ชจ๋ธ ์๋ (XGBoost)
- ์๊ฐ ์๋์ฐ ์กฐ์
์ ๋ฆฌ
ํ๊ท ๋ชจ๋ธ ์ ํ ๊ฐ์ด๋
| ์ํฉ | ์ถ์ฒ ๋ชจ๋ธ |
|---|---|
| ํด์ ํ์, ์ ํ ๊ด๊ณ | ์ ํ ํ๊ท |
| ๋ค์ค๊ณต์ ์ฑ ๋ฌธ์ | Ridge |
| ํผ์ฒ ์ ํ ํ์ | Lasso |
| ๋น์ ํ ๊ด๊ณ, ๋์ฉ๋ | XGBoost |
ํ๊ฐ ์งํ ์ ํ ๊ฐ์ด๋
| ์ํฉ | ์ถ์ฒ ์งํ |
|---|---|
| ์ด์์น ๋ง์ | MAE |
| ํฐ ์ค์ฐจ ํ๋ํฐ | RMSE |
| ๋ชจ๋ธ ์ค๋ช ๋ ฅ | Rยฒ |
| ์ค์ผ์ผ ๋ฌด๊ด ๋น๊ต | MAPE |
๋ค์ ๋จ๊ณ
ํ๊ท ์์ธก์ ๋ง์คํฐํ์ต๋๋ค! ๋ค์์ผ๋ก ์๊ณ์ด ์์ธก์์ Prophet์ ์ฌ์ฉํ ๋งค์ถ/์์ ์์ธก์ ๋ฐฐ์๋ณด์ธ์.