Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

update ndarray version and a few minor corrections #15

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/model_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/supervised.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down