Struct rustlearn::linear_models::sgdclassifier::Hyperparameters [] [src]

pub struct Hyperparameters { /* fields omitted */ }

Hyperparameters for a SGDClassifier model.

Methods

impl Hyperparameters
[src]

Creates new Hyperparameters.

Examples

use rustlearn::prelude::*;
use rustlearn::linear_models::sgdclassifier::Hyperparameters;


let mut model = Hyperparameters::new(4)
                                .learning_rate(1.0)
                                .l2_penalty(0.5)
                                .l1_penalty(0.0)
                                .build();

Set the initial learning rate.

During fitting, the learning rate decreases more for parameters which have have received larger gradient updates. This maintains more stable estimates for common features while allowing fast learning for rare features.

Set the L2 penalty.

Set the L1 penalty.

Coefficient sparsity is achieved by truncating at zero whenever a coefficient update would change its sign.

Build a two-class model.

Build a one-vs-rest multiclass model.

Trait Implementations

impl Encodable for Hyperparameters
[src]

Serialize a value using an Encoder.

impl Decodable for Hyperparameters
[src]

Deserialize a value using a Decoder.