pub fn epoch(&mut self, samples: &DataFrame, count: Option<usize>) -> Option<()> {
        if self.epoch >= self.params.epochs {
            return None;
        }

        let mut rng = rand::thread_rng();
        let mut indices: Vec<_> = (0..samples.nrows()).collect();
        rng.shuffle(&mut indices);

        let cnt = cmp::min(count.unwrap_or_else(|| samples.nrows()), samples.nrows());

        for idx in indices.iter().take(cnt) {
            let sample = samples.get_row(*idx);
            self.train(sample);
        }

        self.decay_weights();

        self.epoch += 1;

        Some(())
    }
/// Trains the SOM for one epoch. Updates learning parameters
Trains the SOM for one epoch. Updates learning parameters
Trains the SOM for one epoch . Updates learning parameters
pub fn epoch(&mut self, samples: &DataFrame, count: Option<usize>) -> Option<()> {
        if self.epoch >= self.params.epochs {
            return None;
        }
        let mut rng = rand::thread_rng();
        let mut indices: Vec<_> = (0..samples.nrows()).collect();
        rng.shuffle(&mut indices);
        let cnt = cmp::min(count.unwrap_or_else(|| samples.nrows()), samples.nrows());
        for idx in indices.iter().take(cnt) {
            let sample = samples.get_row(*idx);
            self.train(sample);
        }
        self.decay_weights();
        self.epoch += 1;
        Some(())
    }
pub fn epoch ( & mut self , samples : & DataFrame , count : Option < usize > ) -> Option < ( ) > { if self . epoch >= self . params . epochs { return None ; } let mut rng = rand :: thread_rng ( ) ; let mut indices : Vec < _ > = ( 0 .. samples . nrows ( ) ) . collect ( ) ; rng . shuffle ( & mut indices ) ; let cnt = cmp :: min ( count . unwrap_or_else ( | | samples . nrows ( ) ) , samples . nrows ( ) ) ; for idx in indices . iter ( ) . take ( cnt ) { let sample = samples . get_row ( * idx ) ; self . train ( sample ) ; } self . decay_weights ( ) ; self . epoch += 1 ; Some ( ( ) ) }
Trains the SOM for one epoch.
Trains the SOM for one epoch .
&mut self
samples
&DataFrame
count
Option<usize>
&mut self
samples
&DataFrame
count
Option<usize>