Skip to content
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
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ cc = "1.0"
[dev-dependencies]
bincode = "1.0"
csv = "0.14"
hyper = "0.7.0"
serde_json = "1.0"
time = "0.1"

[dev-dependencies.reqwest]
version = "0.11.3"
features = ["blocking"]

[features]
all_tests = []
bench = []
18 changes: 3 additions & 15 deletions examples/dorothea.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::io::{Read, Write};
use std::path::Path;
use std::fs::File;

extern crate hyper;
extern crate reqwest;

extern crate rustlearn;

Expand All @@ -21,22 +21,10 @@ use rustlearn::trees::decision_tree;
use rustlearn::ensemble::random_forest;
use rustlearn::metrics;

use hyper::client::Client;


fn download_data(url: &str) -> Result<String, hyper::error::Error> {

let client = Client::new();

let mut output = String::new();

let mut response = try!(client.get(url).send());
try!(response.read_to_string(&mut output));

Ok(output)
fn download_data(url: &str) -> reqwest::Result<String> {
reqwest::blocking::get(url)?.text()
}


fn get_raw_data(url: &str, filename: &str) -> String {

let path = Path::new(filename);
Expand Down