Skip to main content

against_current

Function against_current 

Source
pub(crate) fn against_current(
    dirs: &Dirs,
    test_ids: &[usize],
    test_words: &[Vec<String>],
    messages: &[Message],
    new_scored: &[(f64, bool)],
    options: &Options,
) -> Result<(Option<Numbers>, Option<Compared>, bool, &'static str), LearnError>
Expand description

The table in place, on the same test messages: those of them it never learned from (it learned from every message before its training), so that both are judged on mail they never saw; then whether the new table takes its place (replacement), and why. test_words and new_scored are in test_ids’ order, read with this training’s words (Options::lexicon). Each table reads with its own words: when those of the table in place (Table::lexicon: its own, or the built-in French and English ones when it keeps none) are not this training’s, its test messages are read again from the corpus with them, and one that can no longer be read is left out for both tables; a change of words never makes the table in place look worse than it is.