View source: R/get_transition_info.R
get_transition_info | R Documentation |
Invoke the Transition Pairing Method
get_transition_info(predictions, references, window_size = 1, ...) validate_transition_info_input(predictions, references) impute_trans(x, out_length) recode_trans_names(x)
predictions |
A dummy-coded vector of predicted transitions (1) interspersed with non-transitions (0). Logical vectors are coerced to numeric. |
references |
A dummy-coded vector of actual (i.e., reference) transitions (1) interspersed with non-transitions (0). Logical vectors are coerced to numeric. |
window_size |
The maximum number of indices that are allowed to separate a predicted and reference transition, before the two are considered incompatible |
... |
additional arguments passed to or from methods, not currently used |
an object of class transition
that contains necessary
information for evaluating the effectiveness of the predictions.
If the lengths of predictions
and references
differ, a
warning is issued, and the shorter vector will be expanded to match the
length of the longer, using the original relative/proportional positions of
the transitions to determine where they should be placed in the expanded
vector. The relative position could be determined different ways, each
having unique implications for how well aligned predictions
and
references
are. Therefore, while this function is not unusable when
the lengths differ, you should make sure you know what you're doing if you
want to use it that way. The safest solution is to expand the shorter
vector yourself.
summary.transition
set.seed(100) predictions <- (sample(1:100)%%2) references <- (sample(1:100)%%2) window_size <- 7 if (isTRUE(requireNamespace("matchingMarkets", quietly = TRUE))) { get_transition_info(predictions, references, window_size) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.