pub fn write_normalization(&self, som: &Som, path: &str) -> Result<(), Box<dyn Error>> {
        let mut writer = WriterBuilder::new()
            .delimiter(self.csv_options.delimiter)
            .from_path(path)?;

        let mut colnames: Vec<_> = som.weights().columns().to_vec();
        colnames.insert(0, "param".to_string());
        writer.write_record(&colnames)?;

        let mut row: Vec<_> = self
            .denorm
            .iter()
            .map(|d| d.inverse().scale().to_string())
            .collect();
        row.insert(0, "a_norm".to_string());
        writer.write_record(&row)?;

        let mut row: Vec<_> = self
            .denorm
            .iter()
            .map(|d| d.inverse().offset().to_string())
            .collect();
        row.insert(0, "b_norm".to_string());
        writer.write_record(&row)?;

        let mut row: Vec<_> = self.denorm.iter().map(|d| d.scale().to_string()).collect();
        row.insert(0, "a_denorm".to_string());
        writer.write_record(&row)?;

        let mut row: Vec<_> = self.denorm.iter().map(|d| d.offset().to_string()).collect();
        row.insert(0, "b_denorm".to_string());
        writer.write_record(&row)?;

        Ok(())
    }
/// Writes normalization and de-normalization parameters to CSV file.
Writes normalization and de-normalization parameters to CSV file.
Writes normalization and de - normalization parameters to CSV file .
pub fn write_normalization(&self, som: &Som, path: &str) -> Result<(), Box<dyn Error>> {
        let mut writer = WriterBuilder::new()
            .delimiter(self.csv_options.delimiter)
            .from_path(path)?;
        let mut colnames: Vec<_> = som.weights().columns().to_vec();
        colnames.insert(0, "param".to_string());
        writer.write_record(&colnames)?;
        let mut row: Vec<_> = self
            .denorm
            .iter()
            .map(|d| d.inverse().scale().to_string())
            .collect();
        row.insert(0, "a_norm".to_string());
        writer.write_record(&row)?;
        let mut row: Vec<_> = self
            .denorm
            .iter()
            .map(|d| d.inverse().offset().to_string())
            .collect();
        row.insert(0, "b_norm".to_string());
        writer.write_record(&row)?;
        let mut row: Vec<_> = self.denorm.iter().map(|d| d.scale().to_string()).collect();
        row.insert(0, "a_denorm".to_string());
        writer.write_record(&row)?;
        let mut row: Vec<_> = self.denorm.iter().map(|d| d.offset().to_string()).collect();
        row.insert(0, "b_denorm".to_string());
        writer.write_record(&row)?;
        Ok(())
    }
pub fn write_normalization ( & self , som : & Som , path : & str ) -> Result < ( ) , Box < dyn Error > > { let mut writer = WriterBuilder :: new ( ) . delimiter ( self . csv_options . delimiter ) . from_path ( path ) ? ; let mut colnames : Vec < _ > = som . weights ( ) . columns ( ) . to_vec ( ) ; colnames . insert ( 0 , " " . to_string ( ) ) ; writer . write_record ( & colnames ) ? ; let mut row : Vec < _ > = self . denorm . iter ( ) . map ( | d | d . inverse ( ) . scale ( ) . to_string ( ) ) . collect ( ) ; row . insert ( 0 , " " . to_string ( ) ) ; writer . write_record ( & row ) ? ; let mut row : Vec < _ > = self . denorm . iter ( ) . map ( | d | d . inverse ( ) . offset ( ) . to_string ( ) ) . collect ( ) ; row . insert ( 0 , " " . to_string ( ) ) ; writer . write_record ( & row ) ? ; let mut row : Vec < _ > = self . denorm . iter ( ) . map ( | d | d . scale ( ) . to_string ( ) ) . collect ( ) ; row . insert ( 0 , " " . to_string ( ) ) ; writer . write_record ( & row ) ? ; let mut row : Vec < _ > = self . denorm . iter ( ) . map ( | d | d . offset ( ) . to_string ( ) ) . collect ( ) ; row . insert ( 0 , " " . to_string ( ) ) ; writer . write_record ( & row ) ? ; Ok ( ( ) ) }
Writes normalization and de-normalization parameters to CSV file.
Writes normalization and de - normalization parameters to CSV file .
&self
som
&Som
path
&str
&self
som
&Som
path
&str