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
579
579
/// A new shuffled version of the current Dataset
580
580
/// # Example
581
581
/// ```
582
+ /// use rand::thread_rng;
583
+ /// use ndarray::s;
582
584
/// let dataset = linfa_datasets::iris();
583
585
/// 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() );
586
588
/// let mut rng = thread_rng();
587
589
/// let shuffled = dataset.shuffle(&mut rng);
588
590
/// 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());
591
593
/// ```
592
594
pub fn shuffle < R : Rng > ( & self , rng : & mut R ) -> DatasetBase < Array2 < F > , T :: Owned > {
593
595
let mut indices = ( 0 ..self . nsamples ( ) ) . collect :: < Vec < _ > > ( ) ;
You can’t perform that action at this time.
0 commit comments