View source: R/model-fgt2009.R
| fgt2009_sweep_alpha | R Documentation |
fgt2009()'s alpha trades lexicon size against fit and must scale with
corpus size, and the fit-vs-alpha curve is single-peaked – so a coarse
sweep is the right way to choose it (and to evaluate the model fairly),
rather than a general-purpose optimizer. This runs xsl_run() for each
alpha and returns the per-value SSE against the dataset's human accuracy.
fgt2009_sweep_alpha(
data,
alphas,
rsa = FALSE,
gold = NULL,
...,
control = xslControl()
)
data |
An |
alphas |
Numeric vector of |
rsa |
Logical; if |
gold |
Optional gold-standard lexicon as |
... |
Further arguments to the model constructor (e.g. |
control |
Control arguments passed to |
For a naturalistic corpus (e.g. rollins_corpus, fm_corpus) there is no
human accuracy vector; pass gold (a list(words, objects) lexicon) to also
get the best-threshold F-score of the learned matrix against it (via
get_roc_max()) at each alpha. Remember such corpora also want the
naturalistic-speech gamma = 0.1, kappa = 0.05 rather than the defaults
(see fgt2009()).
A data frame with columns alpha and sse (plus unweighted_sse
when data is a list, or f_max when gold is given).
fgt2009_sweep_alpha(get_example_ambiguous_condition(),
alphas = c(1, 2, 4, 8))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.