fn add_example(&mut self, y: Label) -> bool {
        self.count[y] += 1;
        let mut updated = false;

        if let Some(pred) = self.prediction {
            if y != pred {
                // Did the maximum prior change?
                if self.count[y] > self.count[pred] {
                    self.prediction = Some(y);
                    updated = true;
                }
            }
        } else {
            self.prediction = Some(y);
            updated = true;
        }
        updated
    }
/// Increases the count for an observed label `y`, and changes
/// the prediction if needed.
Increases the count for an observed label `y`, and changes
the prediction if needed.
Increases the count for an observed label ` y ` and changes the prediction if needed .
fn add_example(&mut self, y: Label) -> bool {
        self.count[y] += 1;
        let mut updated = false;
        if let Some(pred) = self.prediction {
            if y != pred {
                // Did the maximum prior change?
                if self.count[y] > self.count[pred] {
                    self.prediction = Some(y);
                    updated = true;
                }
            }
        } else {
            self.prediction = Some(y);
            updated = true;
        }
        updated
    }
fn add_example ( & mut self , y : Label ) -> bool { self . count [ y ] += 1 ; let mut updated = false ; if let Some ( pred ) = self . prediction { if y != pred { // Did the maximum prior change? if self . count [ y ] > self . count [ pred ] { self . prediction = Some ( y ) ; updated = true ; } } } else { self . prediction = Some ( y ) ; updated = true ; } updated }
Increases the count for an observed label `y`, and changes
the prediction if needed.
Increases the count for an observed label ` y ` and changes the prediction if needed .
&mut self
y
Label
&mut self
y
Label