Skip to content

Instantly share code, notes, and snippets.

View chenqin's full-sized avatar

Chen Qin chenqin

View GitHub Profile
@chenqin
chenqin / xgb_quantile_loss.py
Created September 25, 2018 06:00 — forked from Nikolay-Lysenko/xgb_quantile_loss.py
Customized loss function for quantile regression with XGBoost
import numpy as np
def xgb_quantile_eval(preds, dmatrix, quantile=0.2):
"""
Customized evaluational metric that equals
to quantile regression loss (also known as
pinball loss).
Quantile regression is regression that