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]

[src]

Creates a new modelbuilder with reasonable defaults set

[src]

Provides a name for the model

[src]

Sets the ID of the model. If you do not set the ID, suggestionbox will assign you one automatically.

[src]

Adds a new choice to the model builder with the indicated list of features

[src]

Sets the options for the 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.