pub fn nearest_unit(&self, som: &Som, data: &DataFrame) -> Vec<(usize, f64)> {
        assert_eq!(som.weights().columns(), data.columns());

        data.iter_rows()
            .map(|row| nn::nearest_neighbor_xyf(row, som.weights(), self.layers()))
            .collect()
    }
/// Finds the nearest unit in the SOM for each row in `data`.
///
/// # Returns
/// A vector of (unit index, distance).
Finds the nearest unit in the SOM for each row in `data`.
Finds the nearest unit in the SOM for each row in ` data ` .
pub fn nearest_unit(&self, som: &Som, data: &DataFrame) -> Vec<(usize, f64)> {
        assert_eq!(som.weights().columns(), data.columns());
        data.iter_rows()
            .map(|row| nn::nearest_neighbor_xyf(row, som.weights(), self.layers()))
            .collect()
    }
pub fn nearest_unit ( & self , som : & Som , data : & DataFrame ) -> Vec < ( usize , f64 ) > { assert_eq ! ( som weights ( ) columns ( ) data columns ( ) ) ; data . iter_rows ( ) . map ( | row | nn :: nearest_neighbor_xyf ( row , som . weights ( ) , self . layers ( ) ) ) . collect ( ) }
Finds the nearest unit in the SOM for each row in `data`.
Finds the nearest unit in the SOM for each row in ` data ` .
&self
som
&Som
data
&DataFrame
A vector of (unit index, distance).
A vector of ( unit index distance ) .
&self
som
&Som
data
&DataFrame