plot_scores: Plot Scores

View source: R/plots.R

plot_scoresR Documentation

Plot Scores

Description

Plot same writer and different writers reference similarity scores from a validation set. The similarity scores are greater than or equal to zero and less than or equal to one. The interval from 0 to 1 is split into n_bins. The proportion of scores in each bin is calculated and plotted. Optionally, a vertical dotted line may be plotted at an observed similarity score.

Usage

plot_scores(scores, obs_score = NULL, n_bins = 50)

Arguments

scores

A dataframe of scores calculated with get_ref_scores()

obs_score

Optional. A similarity score calculated with calculate_slr()

n_bins

The number of bins

Details

The methods used in this package typically produce many times more different writer scores than same writer scores. For example, ref_scores contains 79,600 different writer scores but only 200 same writer scores. Histograms, which show the frequency of scores, don't handle this class imbalance well. Instead, the rate of scores is plotted.

Value

A ggplot2 plot of histograms

Examples

plot_scores(scores = ref_scores)

plot_scores(scores = ref_scores, n_bins = 70)

# Add a vertical line 0.1 on the horizontal axis.
plot_scores(scores = ref_scores, obs_score = 0.1)


handwriterRF documentation built on April 4, 2025, 5:38 a.m.