Crate openml[][src]

openml-rust

The openml crate provides functions to fetch tasks and data sets from https://openml.org, and run them with machine learning models.

Example

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());
}

Modules

baseline

Implementation of simple baseline models, used for testing and demonstration.

prelude

Structs

PredictiveAccuracy

Classification Accuracy: relative amount of correctly classified labels

RootMeanSquaredError

Root Mean Squared Error

SupervisedClassification

Classification task

SupervisedRegression

Regression task

Traits

MeasureAccumulator

Trait implemented by performance measures

Task