Crate bigml[][src]

Expand description

An unofficial Rust client for BigML’s REST API.

BigML is an commercial machine-learning service. This unofficial library allows you to talk to BigML from Rust.

We focus on passing data to BigML and running WhizzML scripts, though it’s pretty easy to add support for new resource types and resource fields. See our GitHub repository for more information.

use bigml::{Client, resource::{execution, Id, Script}};
use futures::{executor::block_on, FutureExt, TryFutureExt};
use std::{path::Path, str::FromStr};

let username = "username";
let api_key = "api_key";
let path = Path::new("sample.csv");
let script_id: Id<Script> = Id::from_str("script/123abc")?;

// Create a BigML client.
let client = bigml::Client::new(username, api_key)?;

// Create a source (actually, you should do this via S3 for now).
let source =
    block_on(client.create_source_from_path_and_wait(path.to_owned()))?;
println!("{:?}", source);

// Execute the script.
let mut args = execution::Args::default();
args.set_script(script_id);
args.add_input("source-id", &source.resource)?;
args.add_output("my-output");
let execution = block_on(client.create_and_wait(&args))?;
println!("{:?}", execution);

For more information, see the BigML API and our example code.

Re-exports

pub use wait::WaitOptions;

Modules

Resource types manipulated by the BigML API.

Utilities for waiting, timeouts and error retries.

Macros

Try e, and if it fails, allow our wait function to be retried for temporary errors only.

Try e, and if it fails, do not allow our wait function to be retried.

Try e, and if it fails, allow our wait function to be retried.

Structs

A client connection to BigML.

Options specifying how to report progress.

Enums

A BigML-related error.

Statics

The default domain to use for making API requests to BigML.

Type Definitions

A callback which we be callled every time we have a new T value.

A custom Result, for convenience.