Crates.io | openml |
lib.rs | openml |
version | 0.1.2 |
source | src |
created_at | 2018-06-20 21:35:13.481255 |
updated_at | 2018-06-27 16:44:42.059497 |
description | A rust interface to [OpenML](http://openml.org/). |
homepage | |
repository | https://github.com/mbillingr/openml-rust |
max_upload_size | |
id | 71008 |
size | 49,822 |
A rust interface to OpenML.
The aim of this crate is to give rust code access to Machine Learning data hosted by OpenML. Thus, Machine Learning algorithms developed in Rust can be easily applied to state-of-the-art data sets and their performance compared to existing implementations in a reproducable way.
extern crate openml;
use openml::prelude::*;
use openml::{PredictiveAccuracy, SupervisedClassification};
use openml::baseline::NaiveBayesClassifier;
fn main() {
// Load "Supervised Classification on iris" task (https://www.openml.org/t/59)
let task = SupervisedClassification::from_openml(59).unwrap();
println!("Task: {}", task.name());
// run the task
let result: PredictiveAccuracy<_> = task.run(|train, test| {
// train classifier
let nbc: NaiveBayesClassifier<u8> = train
.map(|(x, y)| (x, y))
.collect();
// test classifier
let y_out: Vec<_> = test
.map(|x| nbc.predict(x))
.collect();
Box::new(y_out.into_iter())
});
println!("Classification Accuracy: {}", result.result());
}
get data sets
get tasks
get splits
task types
run tasks
make openml.org optional (manual construction of tasks)