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};
# fn main() -> bigml::Result<()> {
#
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);
#
# Ok(())
# }
For more information, see the BigML API and our example code.
Re-exports§
pub use wait::WaitOptions;
Modules§
- resource
- Resource types manipulated by the BigML API.
- wait
- Utilities for waiting, timeouts and error retries.
Macros§
- try_
wait - Try
e
, and if it fails, allow our wait function to be retried for temporary errors only. - try_
with_ permanent_ failure - Try
e
, and if it fails, do not allow ourwait
function to be retried. - try_
with_ temporary_ failure - Try
e
, and if it fails, allow ourwait
function to be retried.
Structs§
- Client
- A client connection to BigML.
- Progress
Options - Options specifying how to report progress.
Enums§
- Error
- A BigML-related error.
Statics§
- DEFAULT_
BIGML_ DOMAIN - The default domain to use for making API requests to BigML.
Type Aliases§
- Progress
Callback - A callback which we be callled every time we have a new
T
value. - Result
- A custom
Result
, for convenience.