eempf_residuals_metrics | R Documentation |
The metrics calculated with this function are:
RSS: residual sum of squares
MAE: mean absolute error
SAE: sum of absolute errors
RSAE: sum of absolute error in relation to the sum of fluorescence and
LEV: the leverage as described in eempf_leverage
The example contains a way to plot these numbers.
eempf_residuals_metrics(residuals, leverage)
residuals |
data.frame as derived from |
leverage |
list of data.frames as derived from |
a list of data.frames containing residuals metrics for each sample, emission and excitation wavelength
data(eem_list)
data(pf_models)
residuals <- eempf_residuals(pf4[[1]], eem_list, cores = 2)
leverage <- eempf_leverage(pf4[[1]])
metrics <- eempf_residuals_metrics(residuals, leverage)
metrics$sample
## plot different residual metrics
require(dplyr)
require(tidyr)
require(ggplot2)
lapply(names(metrics), function(name){
metrics[[name]] %>%
mutate(mode = name, element = !!sym(name))
}) %>%
bind_rows() %>%
pivot_longer(cols = RSS:LEV, names_to = "metric", values_to = "value") %>%
# uncomment the following line to select certain metrics
# filter(metric %in% c("RSS","LEV")) %>%
ggplot(aes(x = element, y = value, colour = metric))+
geom_point()+
facet_wrap(mode ~ ., ncol = 3, scales = "free")+
theme(axis.text.x = element_text(angle = 90))+
scale_y_continuous(trans="log")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.