Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch RMSE to MSE (true L2 loss) #408

Merged
merged 5 commits into from
Apr 13, 2017
Merged

Switch RMSE to MSE (true L2 loss) #408

merged 5 commits into from
Apr 13, 2017

Conversation

Laurae2
Copy link
Contributor

@Laurae2 Laurae2 commented Apr 12, 2017

To keep consistency with the name "Mean Squared Error" as it is not RMSE.

We may add RMSE back under a better name in another PR, because L2 = MSE being RMSE is causing confusion for users.

@guolinke
Copy link
Collaborator

@Laurae2 can you keep both RMSE and MSE, not just replace it ?

@guolinke guolinke merged commit ba99bcd into microsoft:master Apr 13, 2017
@Laurae2
Copy link
Contributor Author

Laurae2 commented Apr 13, 2017

@guolinke I can try keeping both at the same time. It works it seems!

image

library(lightgbm)
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
data(agaricus.test, package = "lightgbm")
test <- agaricus.test
dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label)
valids <- list(test = dtest)

params <- list(objective = "regression", metric = "rmse", device = "cpu", nthread = 1)
model <- lgb.train(params,
                   dtrain,
                   10,
                   valids,
                   min_data = 1,
                   learning_rate = 1,
                   early_stopping_rounds = 10)
rmse <- as.numeric(model$record_evals$test$rmse$eval)

params <- list(objective = "regression", metric = "mse", device = "cpu", nthread = 1)
model <- lgb.train(params,
                   dtrain,
                   10,
                   valids,
                   min_data = 1,
                   learning_rate = 1,
                   early_stopping_rounds = 10)
mse <- as.numeric(model$record_evals$test$l2$eval)

plot(rmse, mse)
curve(x^2, from = 0, to = 0.03, add = TRUE)

@Laurae2 Laurae2 deleted the patch-1 branch April 13, 2017 10:58
guolinke pushed a commit that referenced this pull request Apr 26, 2017
* RMSE (L2) -> MSE (true L2)

* Remove sqrt unneeded reference

* Square L2 test (RMSE to MSE)

* No square root on test

* Attempt to add RMSE
@lock lock bot locked as resolved and limited conversation to collaborators Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants