Struct machinebox::suggestionbox::Suggestionbox
[−]
[src]
pub struct Suggestionbox { /* fields omitted */ }
The client for the suggestionbox
machine box.
Methods
impl Suggestionbox
[src]
pub fn new(url: &str) -> Suggestionbox
[src]
Creates a new suggestionbox client
pub fn create_model(&self, model: &Model) -> Result<Model, Error>
[src]
Creates a new model and returns a copy of the model as seen by the suggestion box, including the options used in model generation.
pub fn delete_model(&self, id: &str) -> Result<(), Error>
[src]
Deletes a model from the box. If the model doesn't exist, it will return
an error of type Machinebox
indicating an HTTP 404.
pub fn get_model(&self, id: &str) -> Result<Model, Error>
[src]
Retrieves a single model from the box
pub fn list_models(&self) -> Result<Vec<Model>, Error>
[src]
Lists all of the models currently managed by the suggestion box
pub fn get_model_stats(&self, id: &str) -> Result<ModelStats, Error>
[src]
Obtains statistics about the given model
pub fn predict(
&self,
model_id: &str,
request: &PredictionRequest
) -> Result<PredictionResponse, Error>
[src]
&self,
model_id: &str,
request: &PredictionRequest
) -> Result<PredictionResponse, Error>
Asks the suggestionbox to make a prediction based upon the supplied list of features in the prediction request. Keep in mind that these features apply to the user for whom the prediction is being made, and don't imply any direct link to the features associated with model choices.
pub fn reward(
&self,
model_id: &str,
reward_id: &str,
weight: f64
) -> Result<(), Error>
[src]
&self,
model_id: &str,
reward_id: &str,
weight: f64
) -> Result<(), Error>
Reward tells the suggestionbox about a successful prediction. Rewarding predictions
is how this box learns to make better predictions over time. You will need to
submit your reward within the reward_expiration_seconds
timeout period of the model.
pub fn download_state<W>(
&self,
model_id: &str,
buf: &mut W
) -> Result<u64, Error> where
W: Write,
[src]
&self,
model_id: &str,
buf: &mut W
) -> Result<u64, Error> where
W: Write,
Fills the supplied buffer with the contents of the state file obtained
from the machine box. This buffer can be any kind of Write
, which includes
empty vectors, files on disk, etc. The state file is binary. Returns the number
of bytes written to the buffer.
pub fn post_state(&self, source_path: &str) -> Result<Model, Error>
[src]
Submits the state file indicated by the source_path
parameter to the suggestion box
and returns the model originally contained in the state file
pub fn post_state_url(&self, state_url: &str) -> Result<Model, Error>
[src]
Submits a URL to the suggestion box. The suggestion box will download the state contained in the file indicated by the URL and return the model from the state file
Trait Implementations
impl BoxClient for Suggestionbox
[src]
fn url(&self) -> &str
[src]
Indicates the URL of the box
fn info(&self) -> Result<BoxInfo, Error>
[src]
Provides information about the box
fn health(&self) -> Result<Health, Error>
[src]
Checks the health of the box
fn is_live(&self) -> Result<bool, Error>
[src]
Determines whether the box is live
fn is_ready(&self) -> Result<bool, Error>
[src]
Determines if the box is ready. Some boxes may take a while to start up, so you can use this function to check if it is acceptable to start using the box-specific functionality Read more