Description Usage Arguments Value Note See Also Examples
View source: R/Algorithms_assessment.R
Calculate error metrics for all algorithm per cluster
1 2 3 4 5 6 7 8 9 10 11 12 13 |
pred |
prediction of Chla |
meas |
in-situ measurement of Chla |
memb |
membership value matrix |
metrics |
metrics need to be calculated |
log10 |
Should pred and meas be log10-transformed? (default as |
total |
Whether to calculate summarized metrics (default as |
hard.mode |
If |
cal.precision |
Whether to calculate precision (only support for vectorized metrics), default as |
valid.definition |
The definition of valid prediction, default as
|
na.process |
na.process and choose to statistic NA value percent |
plot.col |
option to plot col result for selected metrics (default as |
Results of Assessment_via_cluster
are returned as a list including:
Metrcs |
A list of the selected metric values for all algorithms. |
res_plot |
Bar plots by using ggplot function for metrics value at every cluster. |
res_plot_dt |
Dataframe for plotting |
res_plot_facet |
|
input |
input parameters of Assessment_via_cluster |
If the cal.precision
is TRUE
, the hard.mode == TRUE
is used. In that case,
mean and sd calculation is conducted for hard mode based on result from cal.metrics.vector.
Other Algorithm assessment:
Getting_Asses_results()
,
Sampling_via_cluster()
,
Score_algorithms_interval()
,
Score_algorithms_sort()
,
Scoring_system()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | library(FCMm)
library(ggplot2)
library(magrittr)
library(stringr)
data("Nechad2015")
x <- Nechad2015[,3:11]
wv <- gsub("X","",names(x)) %>% as.numeric
set.seed(1234)
w <- sample(1:nrow(x), 100)
x <- x[w, ]
names(x) <- wv
nb = 4 # Obtained from the vignette "Cluster a new dataset by FCMm"
set.seed(1234)
FD <- FuzzifierDetermination(x, wv, stand=FALSE)
result <- FCM.new(FD, nb, fast.mode = TRUE)
p.spec <- plot_spec(result, show.stand=TRUE)
print(p.spec$p.cluster.spec)
Chla <- Nechad2015$X.Chl_a..ug.L.[w]
Chla[Chla >= 999] <- NA
dt_Chla <- run_all_Chla_algorithms(x) %>% as.data.frame
dt_Chla <- data.frame(Chla_true = Chla,
BR_Gil10 = dt_Chla$BR_Gil10,
OC4_OLCI = dt_Chla$OC4_OLCI,
OCI_Hu12 = dt_Chla$OCI_Hu12,
NDCI_Mi12= dt_Chla$NDCI_Mi12) %>% round(3)
w = which(!is.na(dt_Chla$Chla_true))
dt_Chla = dt_Chla[w,]
memb = result$res.FCM$u[w,] %>% round(4)
Asses_soft <- Assessment_via_cluster(pred = dt_Chla[,-1],
meas = dt_Chla[,1], memb = memb, log10 = TRUE, hard.mode = FALSE,
na.process = TRUE, plot.col = TRUE)
Asses_soft$res_plot_facet
knitr::kable(Asses_soft$MAE %>% round(3))
knitr::kable(Asses_soft$MAPE %>% round(2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.