From a61941581a594c9bc6135cb545d27d8af8b9d0c3 Mon Sep 17 00:00:00 2001 From: MarcoDiFrancesco Date: Fri, 3 May 2024 15:50:44 +0200 Subject: [PATCH] Remove unused imports --- examples/classification/keystroke.rs | 12 ++++-------- examples/classification/synthetic.rs | 8 +++----- src/classification/mondrian_forest.rs | 23 ++++++----------------- src/classification/mondrian_node.rs | 25 +++++++------------------ src/classification/mondrian_tree.rs | 25 +++++++------------------ src/datasets/synthetic.rs | 3 +-- 6 files changed, 28 insertions(+), 68 deletions(-) diff --git a/examples/classification/keystroke.rs b/examples/classification/keystroke.rs index 916f283..8ac52b7 100644 --- a/examples/classification/keystroke.rs +++ b/examples/classification/keystroke.rs @@ -1,15 +1,11 @@ -use light_river::classification::alias::FType; use light_river::classification::mondrian_forest::MondrianForest; -use light_river::classification::mondrian_tree::MondrianTree; -use light_river::common::ClassifierOutput; + use light_river::common::ClassifierTarget; use light_river::datasets::keystroke::Keystroke; -use light_river::metrics::rocauc::ROCAUC; -use light_river::metrics::traits::ClassificationMetric; -use light_river::stream::data_stream::DataStream; + use light_river::stream::iter_csv::IterCsv; -use ndarray::{s, Array1}; -use std::borrow::Borrow; +use ndarray::Array1; + use std::fs::File; use std::time::Instant; diff --git a/examples/classification/synthetic.rs b/examples/classification/synthetic.rs index 9e4be53..723eb23 100644 --- a/examples/classification/synthetic.rs +++ b/examples/classification/synthetic.rs @@ -1,13 +1,11 @@ -use light_river::classification::alias::FType; use light_river::classification::mondrian_forest::MondrianForest; -use light_river::classification::mondrian_tree::MondrianTree; -use light_river::common::ClassifierOutput; + use light_river::common::ClassifierTarget; use light_river::datasets::synthetic::Synthetic; use light_river::stream::iter_csv::IterCsv; -use ndarray::{s, Array1}; +use ndarray::Array1; use num::ToPrimitive; -use std::borrow::Borrow; + use std::fs::File; use std::time::Instant; diff --git a/src/classification/mondrian_forest.rs b/src/classification/mondrian_forest.rs index 44713df..50a256c 100644 --- a/src/classification/mondrian_forest.rs +++ b/src/classification/mondrian_forest.rs @@ -1,25 +1,14 @@ use crate::classification::alias::FType; use crate::classification::mondrian_tree::MondrianTree; -use crate::common::{ClassifierOutput, ClassifierTarget, Observation}; -use crate::stream::data_stream::Data; -use core::iter::zip; -use ndarray::array; -use ndarray::{arr1, Array1, Array2}; -use ndarray::{ArrayBase, Dim, ScalarOperand, ViewRepr}; -use num::pow::Pow; -use num::traits::float; + +use ndarray::Array1; + use num::{Float, FromPrimitive}; use rand::prelude::*; -use std::cell::RefCell; + use std::collections::HashMap; -use std::convert::TryFrom; -use std::env::consts; -use std::iter::FlatMap; -use std::ops::{Add, Div, Mul, Sub}; -use std::ops::{AddAssign, DivAssign, MulAssign, SubAssign}; -use std::rc::Rc; -use std::rc::Weak; -use std::{cmp, mem, usize}; + +use std::usize; pub struct MondrianForest { trees: Vec>, diff --git a/src/classification/mondrian_node.rs b/src/classification/mondrian_node.rs index eb3e33d..2b1f40c 100644 --- a/src/classification/mondrian_node.rs +++ b/src/classification/mondrian_node.rs @@ -1,25 +1,14 @@ use crate::classification::alias::FType; -use crate::common::{ClassifierOutput, ClassifierTarget, Observation}; -use crate::stream::data_stream::Data; -use core::iter::zip; -use ndarray::{array, Array3}; + use ndarray::{Array1, Array2}; -use ndarray::{ArrayBase, Dim, ScalarOperand, ViewRepr}; -use num::pow::Pow; -use num::traits::float; + use num::{Float, FromPrimitive}; -use rand::prelude::*; -use std::cell::RefCell; -use std::collections::HashMap; -use std::convert::TryFrom; -use std::env::consts; + use std::fmt; -use std::iter::FlatMap; -use std::ops::{Add, Div, Mul, Sub}; -use std::ops::{AddAssign, DivAssign, MulAssign, SubAssign}; -use std::rc::Rc; -use std::rc::Weak; -use std::{clone, cmp, mem, usize}; + +use std::ops::Add; + +use std::usize; /// Node struct #[derive(Clone)] diff --git a/src/classification/mondrian_tree.rs b/src/classification/mondrian_tree.rs index 5520d1b..f853dca 100644 --- a/src/classification/mondrian_tree.rs +++ b/src/classification/mondrian_tree.rs @@ -1,28 +1,17 @@ use crate::classification::alias::FType; use crate::classification::mondrian_node::{Node, Stats}; -use crate::common::{ClassifierOutput, ClassifierTarget, Observation}; -use crate::stream::data_stream::Data; -use core::iter::zip; -use ndarray::{array, Array}; -use ndarray::{Array1, Array2}; -use ndarray::{ArrayBase, Dim, ScalarOperand, ViewRepr}; -use num::pow::Pow; -use num::traits::float; + +use ndarray::Array1; + use num::{Float, FromPrimitive}; use rand::prelude::*; use rand_distr::{Distribution, Exp}; -use std::cell::RefCell; -use std::collections::HashMap; + use std::collections::HashSet; -use std::convert::TryFrom; -use std::env::consts; + use std::fmt; -use std::iter::FlatMap; -use std::ops::{Add, Div, Mul, Sub}; -use std::ops::{AddAssign, DivAssign, MulAssign, SubAssign}; -use std::rc::Rc; -use std::rc::Weak; -use std::{clone, cmp, mem, usize}; + +use std::usize; #[derive(Clone)] pub struct MondrianTree { diff --git a/src/datasets/synthetic.rs b/src/datasets/synthetic.rs index 26f7058..1e0c80d 100644 --- a/src/datasets/synthetic.rs +++ b/src/datasets/synthetic.rs @@ -1,7 +1,6 @@ -use crate::datasets::utils; use crate::stream::data_stream::Target; use crate::stream::iter_csv::IterCsv; -use std::{fs::File, path::Path}; +use std::fs::File; /// ChatGPT Generated synthetic dataset. ///