74MZGCMIZF4AC2MWUM5IWQT3VACOMLI5AHNSYAWCEKUL4C2D36PQC
UYYSWKUVHPSAX4KIQZSKDW7HB7EHWEJ2Q4EKE4MCYL5REWXVX42QC
PGIJJK2MGH2SHXUAJQ6LA3HZVC7KJC563WGD6XIEP3J436YW3NUAC
LHETILNNYVQ27JCR5WGRAPDRQBFORK77UDJDMAZ4E47PC7ZPS7RAC
Q7BIMIWQJHBLNB7LYSYAORQPQ2CKRZSOR3VKASIRWBGJWEMICM2AC
use ndarray_linalg::Norm;
use ndarray_linalg::{Norm, Scalar};
println!("idf vector: {:?}", idf_vector);
println!("idf vector sm: {:?}", idf_vector);
idf_vector.mapv_inplace(|df| (n_samples as f64 / df).log10() + 1.0);
idf_vector.mapv_inplace(|df| (n_samples as f64 / df).ln() + 1.0);
pub fn transform(&self, mut matrix: Array2<f64>) -> Array2<f64> {
pub fn transform(&self, matrix: Array2<f64>) -> Array2<f64> { let mut matrix = matrix;
pub fn transform(&self, matrix: Array2<f64>) -> Array2<f64> {
let mut matrix = matrix;
} pub fn fit_transform(&mut self, matrix: Array2<f64>) -> Array2<f64> { if self.idf.is_none() { self.fit(&matrix); } self.transform(matrix)
}
pub fn fit_transform(&mut self, matrix: Array2<f64>) -> Array2<f64> {
if self.idf.is_none() {
self.fit(&matrix);
self.transform(matrix)
// This is a bit wasteful since we allocate a new String for every word
println!("{:?}", r);
//println!("{:?}", r);