Skip to content

Instantly share code, notes, and snippets.

@Steboss89
Created June 29, 2021 15:15
Show Gist options
  • Save Steboss89/8f4541c50e0cd5e20efc47795da27d59 to your computer and use it in GitHub Desktop.
Save Steboss89/8f4541c50e0cd5e20efc47795da27d59 to your computer and use it in GitHub Desktop.
fn main() {
// Read input data
let ifile = "Boston.csv";
// read and return a dataframe
let df = read_csv(&ifile).unwrap();
// size and shape
let height = df.height();
let cols = df.width();
// select features
let (features, target) = feature_and_target(&df);
//println!("{:#?}", features.unwrap());
// convert to array
let features_res = features.unwrap().to_ndarray::<Float64Type>().unwrap();
let target_array = target.unwrap().to_ndarray::<Float64Type>().unwrap();
let (x_train, x_test, y_train, y_test) = train_test_split(&features_res, &target_array, 0.3, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment