View source: R/threshold_strategies.R
threshold_strategies | R Documentation |
Subsets strategy calls based on a threshold.
threshold_strategies(strategies, threshold = NULL)
strategies |
An |
threshold |
A numeric value between 0 and 1. |
For strategy-calling algorithms yielding a confidence score (such as
call_strategy
), a value between 0 and 1 will return a new
rtrack_strategies
object only including calls with a confidence score
above the given threshold.
An rtrack_strategies
object including only above-threshold
calls. In addition, the component thresholded
is set to TRUE
if thresholding was performed.
require(Rtrack)
track_file <- system.file("extdata", "Track_1.tab", package = "Rtrack")
arena_description <- system.file("extdata", "Arena.txt", package = "Rtrack")
arena <- read_arena(arena_description)
path <- read_path(track_file, arena, track.format = "raw.tab")
metrics <- calculate_metrics(path, arena)
strategies <- call_strategy(metrics)
# Inspect the strategy call (minimal experiment only has one track)
strategies$calls
# Thresholding at 0.7 will retain the track (confidence = 0.72)
strategies = threshold_strategies(strategies, threshold = 0.7)
strategies$calls
# Thresholding at 0.8 will discard the track, still returning an (empty) rtrack_strategies object
strategies = threshold_strategies(strategies, threshold = 0.8)
strategies$calls
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.