R/col_cont_metrics.R

Defines functions colukl colpkl colmaes colmses

Documented in colmaes colmses colpkl colukl

#[export]
colmses <- function(y, yhat, parallel = FALSE) {
  Rfast::colmeans( (y - yhat)^2, parallel = parallel )
}


#[export]
colmaes <- function(y, yhat, parallel = FALSE) {
  Rfast::colmeans( abs(y - yhat), parallel = parallel )
}


#[export]
colpkl <- function(y, yhat, parallel = FALSE) {
 y1 <- 1 - y
 Rfast::colsums( y * log(y / yhat), na.rm = TRUE, parallel = parallel ) +  
 Rfast::colsums( y1 * log( y1 / (1 - yhat) ), na.rm = TRUE, parallel = parallel )
}


#[export]
colukl <- function(y, yhat, parallel = FALSE) {
 Rfast::colsums( y * log(y / yhat), na.rm = TRUE, parallel = parallel )
}

Try the Rfast2 package in your browser

Any scripts or data that you put into this service are public.

Rfast2 documentation built on Aug. 8, 2023, 1:11 a.m.