{SLmetrics} v0.1-1
Note
Version 0.1-1 is considered pre-release of {SLmetrics}. We do not
expect any breaking changes, unless a major bug/issue is reported and
its nature forces breaking changes.
General
- Backend changes: All pair-wise metrics arer moved from {Rcpp} to
C++, this have reduced execution time by half. All pair-wise metrics
are now faster.
Improvements
- NA-controls: All pair-wise metrics that doesn’t have a
micro
-argument were handling missing values as according to C++
and {Rcpp} internals. See
Issue. Thank you
@EmilHvitfeldt for pointing this out. This has now been fixed so
functions uses anna.rm
-argument to explicitly control for this.
See below,
# 1) define factors
actual <- factor(c("no", "yes"))
predicted <- factor(c(NA, "no"))
# 2) accuracy with na.rm = TRUE
SLmetrics::accuracy(
actual = actual,
predicted = predicted,
na.rm = TRUE
)
#> [1] 0
# 2) accuracy with na.rm = FALSE
SLmetrics::accuracy(
actual = actual,
predicted = predicted,
na.rm = FALSE
)
#> [1] NaN
Bug-fixes
- The
plot.prROC()
- andplot.ROC()
-functions now adds a line to
the plot whenpanels = FALSE
. See Issue
#9.
# 1) define actual
# classes
actual <- factor(
sample(letters[1:2], size = 100, replace = TRUE)
)
# 2) define response
# probabilities
response <- runif(100)
# 3) calculate
# ROC and prROC
# 3.1) ROC
roc <- SLmetrics::ROC(
actual,
response
)
# 3.2) prROC
prroc <- SLmetrics::prROC(
actual,
response
)
# 4) plot with panels
# FALSE
par(mfrow = c(1,2))
plot(
roc,
panels = FALSE
)
plot(
prroc,
panels = FALSE
)