Acepilot Post#1
mean_pinball_lossの動作確認で q = 0.5 は MAEに等しいらしいですが、値が一致しません。
MAEの値もおかしいと思いますが、どうでしょうか?
sample code
from sklearn.metrics import mean_pinball_loss
from sklearn.metrics import median_absolute_error
import sklearn as sk
print(f'{sk.version = }')
print()
y_true = [ 3, -0.5, 2, 7]
y_pred = [2.5, 0.0, 2, 8]
for q in [0.01, 0.1, 0.5, 0.9, 0.99]:
loss = mean_pinball_loss(y_true, y_pred, alpha=q)
print(f'{q=}, {loss=}')
print()
mae = median_absolute_error(y_true, y_pred)
print(f'MAE(0.5) = {mae: .4f}')
output
sk.version = '1.1.3'
q=0.01, loss=0.3725
q=0.1, loss=0.35
q=0.5, loss=0.25
q=0.9, loss=0.15
q=0.99, loss=0.1275
MAE(0.5) = 0.5000