Skip to content

Commit 0190319

Browse files
committed
fixed formatting issues
1 parent 583a41f commit 0190319

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/dataset/impl_dataset.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,18 +580,14 @@ where
580580
/// # Example
581581
/// ```
582582
/// let dataset = linfa_datasets::iris();
583-
584583
/// println!("First 5 rows {:?}", dataset.records.slice(s![0..5,..]));
585584
/// let feature_names = dataset.feature_names();
586585
/// let target_names = dataset.target_names();
587-
588586
/// let mut rng = thread_rng();
589587
/// let shuffled = dataset.shuffle(&mut rng);
590-
591588
/// println!("First 5 rows after shuffling {:?}", shuffled.records.slice(s![0..5,..]));
592589
/// assert_eq!(feature_names, shuffled.feature_names());
593-
/// /// assert_eq!(target_names, shuffled.target_names());
594-
///
590+
/// assert_eq!(target_names, shuffled.target_names());
595591
/// ```
596592
pub fn shuffle<R: Rng>(&self, rng: &mut R) -> DatasetBase<Array2<F>, T::Owned> {
597593
let mut indices = (0..self.nsamples()).collect::<Vec<_>>();
@@ -601,7 +597,9 @@ where
601597
let targets = self.as_targets().select(Axis(0), &indices);
602598
let targets = T::new_targets(targets);
603599

604-
DatasetBase::new(records, targets).with_feature_names(self.feature_names().to_vec()).with_target_names(self.target_names().to_vec())
600+
DatasetBase::new(records, targets)
601+
.with_feature_names(self.feature_names().to_vec())
602+
.with_target_names(self.target_names().to_vec())
605603
}
606604

607605
#[allow(clippy::type_complexity)]

0 commit comments

Comments
 (0)