How to Win a Data Science Competition (Week3-1 part2)
Kaggle 機械学習
Published: 2019-06-23

Metrics optimization

学習目標

  • Describe the role of correct metric optimization method in a competition
  • Analyze new metrics
  • Create constant baselines
  • Recall the most important classification and regression metrics
  • Describe what libraries can be used to optimize a particular metric

Regression metrics review II

今回対象のメトリクス

  • ®MSPE, MAPE
  • ®MSLE

MSPE: Mean Square Percentage Error

$$ MSPE = \frac{100\%}{N}\sum_{i=1}^N(\frac{y_i - \hat{y_i}}{y_i})^2 $$

最適な定数は加重平均

MAPE: Mean Absolute Percentage Error

$$ MSPE = \frac{100\%}{N}\sum_{i=1}^N|\frac{y_i - \hat{y_i}}{y_i}| $$

最適な定数は加重中央値

®MSLE: Root Mean Square Logarithmic Error

対数スケールで計算された RMSE

$$ RMSLE = \sqrt{\frac{1}{N}\sum_{i=1}^N (log({y_i}+1) - log(\hat{y_i} + 1))^2} $$

$$ = RMSE(log({y_i}+1), log(\hat{y_i} + 1) = \sqrt{MSE(log({y_i}+1), log(\hat{y_i} + 1)} $$

対数空間で RMSE の定数を見つけ、対数空間から逆変換する必要がある

参考