diff --git a/Cargo.toml b/Cargo.toml index 4eb09fc..7f83962 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ categories = ["science"] [dependencies] smartcore = { path = "../smartcore", default-features = false, features=["serde", "nalgebra-bindings", "ndarray-bindings", "datasets"]} structopt = "0.3.17" -ndarray = "0.14" +ndarray = "0.15" nalgebra = "0.31" plotters = "^0.3.0" serde = "1.0.115" diff --git a/src/model_selection.rs b/src/model_selection.rs index 176ff1d..7de89db 100644 --- a/src/model_selection.rs +++ b/src/model_selection.rs @@ -73,8 +73,8 @@ pub fn lr_cross_validate() { LogisticRegression::fit, &x, &y, - Default::default(), - KFold::default().with_n_splits(3), + &Default::default(), + &KFold::default().with_n_splits(3), accuracy, ) .unwrap(); diff --git a/src/supervised.rs b/src/supervised.rs index c5d0590..fdfe63b 100644 --- a/src/supervised.rs +++ b/src/supervised.rs @@ -39,7 +39,7 @@ pub fn diabetes() { let y = diabetes_data.target; // Split dataset into training/test (80%/20%) - let (x_train, x_test, y_train, y_test) = train_test_split(&x, &y, 0.2, true); + let (x_train, x_test, y_train, y_test) = train_test_split(&x, &y, 0.2, true, None); // SVM let y_hat_svm = SVR::fit( @@ -72,7 +72,7 @@ pub fn breast_cancer() { let y = cancer_data.target; // Split dataset into training/test (80%/20%) - let (x_train, x_test, y_train, y_test) = train_test_split(&x, &y, 0.2, true); + let (x_train, x_test, y_train, y_test) = train_test_split(&x, &y, 0.2, true, None); // KNN classifier let y_hat_knn = KNNClassifier::fit(&x_train, &y_train, Default::default()) @@ -122,7 +122,7 @@ pub fn boston() { // These are our target values let y = boston_data.target; - let (x_train, x_test, y_train, y_test) = train_test_split(&x, &y, 0.2, true); + let (x_train, x_test, y_train, y_test) = train_test_split(&x, &y, 0.2, true, None); // KNN regressor let y_hat_knn = KNNRegressor::fit(&x_train, &y_train, Default::default())