Skip to content

{SLmetrics} v0.1-1

Compare
Choose a tag to compare
@serkor1 serkor1 released this 08 Dec 18:25
· 37 commits to main since this release
29a2b5d

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 an na.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()- and plot.ROC()-functions now adds a line to
    the plot when panels = 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
)