feat: refactors packages layout

This commit is contained in:
Volodymyr Orlov
2020-03-13 14:30:45 -07:00
parent 4f8318e933
commit 87b6fab795
12 changed files with 10 additions and 27 deletions
-23
View File
@@ -1,23 +0,0 @@
use crate::common::Nominal;
pub mod knn;
pub mod logistic_regression;
pub mod decision_tree;
pub mod random_forest;
pub trait Classifier<X, Y>
where
Y: Nominal
{
fn predict(&self, x: &X) -> Y;
fn predict_vec(&self, x: &Vec<X>) -> Vec<Y>{
let mut result = Vec::new();
for xv in x.iter() {
result.push(self.predict(xv));
}
result
}
}
+1
View File
@@ -0,0 +1 @@
pub mod random_forest;
@@ -3,7 +3,7 @@ extern crate rand;
use rand::Rng;
use std::default::Default;
use crate::linalg::Matrix;
use crate::classification::decision_tree::{DecisionTree, DecisionTreeParameters, SplitCriterion, which_max};
use crate::tree::decision_tree::{DecisionTree, DecisionTreeParameters, SplitCriterion, which_max};
#[derive(Debug, Clone)]
pub struct RandomForestParameters {
+4 -2
View File
@@ -1,5 +1,7 @@
pub mod classification;
pub mod regression;
pub mod linear;
pub mod neighbors;
pub mod ensemble;
pub mod tree;
pub mod cluster;
pub mod decomposition;
pub mod linalg;
+2
View File
@@ -0,0 +1,2 @@
pub mod linear_regression;
pub mod logistic_regression;
+1
View File
@@ -0,0 +1 @@
pub mod knn;
-1
View File
@@ -1 +0,0 @@
pub mod linear_regression;
+1
View File
@@ -0,0 +1 @@
pub mod decision_tree;