Struct rustlearn::factorization::factorization_machines::Hyperparameters
[−]
[src]
pub struct Hyperparameters { // some fields omitted }
Hyperparameters for a FactorizationMachine
Methods
impl Hyperparameters
[src]
fn new(dim: usize, num_components: usize) -> Hyperparameters
Creates new Hyperparameters.
The complexity of the model is controlled by the dimensionality of the factorization matrix:
a higher num_components
setting will make the model more expressive
at the expense of training time and risk of overfitting.
fn learning_rate(&mut self, learning_rate: f32) -> &mut Hyperparameters
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.
fn l2_penalty(&mut self, l2_penalty: f32) -> &mut Hyperparameters
Set the L2 penalty.
fn l1_penalty(&mut self, l1_penalty: f32) -> &mut Hyperparameters
Set the L1 penalty.
fn rng(&mut self, rng: StdRng) -> &mut Hyperparameters
fn build(&self) -> FactorizationMachine
Build a two-class model.
fn one_vs_rest(&self) -> OneVsRestWrapper<FactorizationMachine>
Build a one-vs-rest multiclass model.