pub fn nearest_neighbor_tanimoto(from: &[f64], to: &DataFrame) -> (usize, f64) {
    assert_eq!(from.len(), to.ncols());

    let mut min_dist = std::f64::MAX;
    let mut min_idx: usize = 0;
    for (idx_to, row_to) in to.iter_rows().enumerate() {
        let dist = TANIMOTO.distance(from, row_to);
        if dist < min_dist {
            min_dist = dist;
            min_idx = idx_to
        }
    }
    (min_idx, min_dist.sqrt())
}
/// Nearest-neighbor by Tanimoto distance.
/// Dimensions with `NA` values are ignored.
/// # Returns
/// (index, distance)
Nearest-neighbor by Tanimoto distance.
Dimensions with `NA` values are ignored.
Nearest - neighbor by Tanimoto distance . Dimensions with ` NA ` values are ignored .
pub fn nearest_neighbor_tanimoto(from: &[f64], to: &DataFrame) -> (usize, f64) {
    assert_eq!(from.len(), to.ncols());
    let mut min_dist = std::f64::MAX;
    let mut min_idx: usize = 0;
    for (idx_to, row_to) in to.iter_rows().enumerate() {
        let dist = TANIMOTO.distance(from, row_to);
        if dist < min_dist {
            min_dist = dist;
            min_idx = idx_to
        }
    }
    (min_idx, min_dist.sqrt())
}
pub fn nearest_neighbor_tanimoto ( from : & [ f64 ] , to : & DataFrame ) -> ( usize , f64 ) { assert_eq ! ( from len ( ) to ncols ( ) ) ; let mut min_dist = std :: f64 :: MAX ; let mut min_idx : usize = 0 ; for ( idx_to , row_to ) in to . iter_rows ( ) . enumerate ( ) { let dist = TANIMOTO . distance ( from , row_to ) ; if dist < min_dist { min_dist = dist ; min_idx = idx_to } } ( min_idx , min_dist . sqrt ( ) ) }
Nearest-neighbor by Tanimoto distance.
Nearest - neighbor by Tanimoto distance .
from
&[f64]
to
&DataFrame
None
from
&[f64]
to
&DataFrame