I've been trying the following custom loss for a regression task in Lightgbm and boosting type = "goss", and I'm getting a segmentation fault:
def hm(y_true, y_pred):
residual = (y_true - y_pred).astype("float")
residual_abs = np.fabs(residual)
grad = np.where(residual_abs<=300,
np.copysign(1, -residual)* 0.5,
np.where(residual_abs>=900,
np.copysign(1, -residual)* 1,
np.copysign(1, -residual)* 2))
hess = np.ones(y_true.shape[0])
return grad, hess
Any ideas why it might be failing? Im using goss and default hyperparameters