Create RMSLE metric in caret in r

拟墨画扇 提交于 2019-12-04 21:07:19

I also encountered the same issue in my project. This is even after loading the Metrics package in memory using the below command.
library(Metrics)

If you see, rmsle function is being called from another function called custom_summary. It is not called directly. So I loaded the Metrics package from within the function custom_summary and it solved the issue for me.

so here, the custom_summary function should look like:

custom_summary = function(data, lev = NULL, model = NULL) {
library(Metrics)
out = rmsle(data[, "obs"], data[, "pred"])
names(out) = c("rmsle")
out
}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!