View source: R/target-uncertainty.R
| bootstrap_gazepoint_metrics_by_unit | R Documentation |
Resamples observations or declared clusters while preserving every row that belongs to a sampled cluster. Repeated cluster draws duplicate all associated rows. The returned object records the resampling unit and must not be described as uncertainty for another unit.
bootstrap_gazepoint_metrics_by_unit(
task,
truth,
prediction = NULL,
probability = NULL,
participant_id = NULL,
stimulus_id = NULL,
unit = c("observation", "participant", "stimulus", "participant_and_stimulus"),
bootstrap = 1000L,
conf_level = 0.95,
seed = 1L,
threshold = 0.5,
stratify_observations = TRUE
)
## S3 method for class 'gp3ml_target_uncertainty'
print(x, ...)
task |
Governed task. |
truth |
Observed outcomes. |
prediction |
Predicted classes or numeric outcomes. |
probability |
Positive-class probabilities. |
participant_id |
Participant identifiers for participant-based methods. |
stimulus_id |
Stimulus identifiers for stimulus-based methods. |
unit |
Resampling unit. |
bootstrap |
Number of replicates. |
conf_level |
Percentile interval level. |
seed |
Deterministic seed. |
threshold |
Classification threshold. |
stratify_observations |
Whether the observation-level classification bootstrap preserves class counts. |
x |
An object returned by the corresponding gp3ml constructor, evaluator, summarizer, or validator. |
... |
Additional arguments passed to the print method. |
A gp3ml_target_uncertainty object.
data <- simulate_gazepoint_governed_data(12L, 4L, 1L, 404L)
task <- create_gazepoint_synthetic_task(data, "recording_quality", "new_participants")
probability <- seq(0.15, 0.85, length.out = nrow(data))
prediction <- factor(
ifelse(probability >= 0.5, "review", "pass"),
levels = levels(data$quality_status)
)
uncertainty <- bootstrap_gazepoint_metrics_by_unit(
task,
truth = data$quality_status,
prediction = prediction,
probability = probability,
participant_id = data$participant_id,
unit = "participant",
bootstrap = 20L,
seed = 404L
)
uncertainty
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.