
<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
LightGBM Custom Loss Function

<ASSISTANT_TASK:>
Python Code::
import LightGBM as lgb
def custom_loss(y_pred, data):
    y_true = data.get_label()
    error = y_pred-y_true
    
    #1st derivative of loss function
    grad = 2 * error
    #2nd derivative of loss function
    hess = 0 * error + 2
    
    return grad, hess
params = {"learning_rate" : 0.1}
training_data = lgb.Dataset(X_train , label = y_train)
model = lgb.train(train_set=training_data,
                  params=params, 
                  fobj=custom_loss)

<END_TASK>
