I'm trying to find what is the score function for the LightGBM regressor. In their documentation page I could not find any information regarding the function used to calculate the score attribute...


1 Answer 1


The score function of the LGBMRegressor is the R-squared.

from lightgbm import LGBMRegressor
from sklearn.datasets import make_regression
from sklearn.metrics import r2_score

X, y = make_regression(random_state=42)

model = LGBMRegressor()
model.fit(X, y)
y_pred = model.predict(X)

print(model.score(X, y))
# 0.9863556751160256

print(r2_score(y, y_pred))
# 0.9863556751160256
  • $\begingroup$ Good to see you here as well ;) $\endgroup$
    – desertnaut
    Nov 3, 2021 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.