File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -579,15 +579,17 @@ where
579579 /// A new shuffled version of the current Dataset
580580 /// # Example
581581 /// ```
582+ /// use rand::thread_rng;
583+ /// use ndarray::s;
582584 /// let dataset = linfa_datasets::iris();
583585 /// println!("First 5 rows {:?}", dataset.records.slice(s![0..5,..]));
584- /// let feature_names = dataset.feature_names();
585- /// let target_names = dataset.target_names();
586+ /// println!("Feature names {:?}", dataset.feature_names() );
587+ /// println!("Target names {:?}", dataset.target_names() );
586588 /// let mut rng = thread_rng();
587589 /// let shuffled = dataset.shuffle(&mut rng);
588590 /// println!("First 5 rows after shuffling {:?}", shuffled.records.slice(s![0..5,..]));
589- /// assert_eq!(feature_names , shuffled.feature_names());
590- /// assert_eq!(target_names , shuffled.target_names());
591+ /// println!("Feature names after shuffling {:?}" , shuffled.feature_names());
592+ /// println!("Target names after shuffling {:?}" , shuffled.target_names());
591593 /// ```
592594 pub fn shuffle < R : Rng > ( & self , rng : & mut R ) -> DatasetBase < Array2 < F > , T :: Owned > {
593595 let mut indices = ( 0 ..self . nsamples ( ) ) . collect :: < Vec < _ > > ( ) ;
You can’t perform that action at this time.
0 commit comments