Struct machinebox::suggestionbox::ModelBuilder
[−]
[src]
pub struct ModelBuilder { /* fields omitted */ }
Allows for natural, fluent creation of new models for submission to the suggestionbox.
Examples
use machinebox::suggestionbox::{ModelBuilder, Feature}; let newmodel = ModelBuilder::new() .named("My model") .id("model1") .choice( "article1", vec![Feature::text("title", "Machine Box releases new product")]) .choice( "article2", vec![Feature::text("title", "The beatles reunite")]) .finish();
Methods
impl ModelBuilder
[src]
fn new() -> ModelBuilder
[src]
Creates a new modelbuilder with reasonable defaults set
fn named(self, name: &str) -> ModelBuilder
[src]
Provides a name for the model
fn id(self, id: &str) -> ModelBuilder
[src]
Sets the ID of the model. If you do not set the ID, suggestionbox will assign you one automatically.
fn choice(self, id: &str, features: Vec<Feature>) -> ModelBuilder
[src]
Adds a new choice to the model builder with the indicated list of features
fn options(self, options: ModelOptions) -> ModelBuilder
[src]
Sets the options for the model
fn finish(self) -> Model
[src]
Creates a new from the builder. As indicated by the name finish
, this builder
will be unusable after this method call as its values will have moved into the new
Model
.