+++ title = "Elastic Net" +++ ```rust let (train, valid) = linfa_datasets::diabetes() .split_with_ratio(0.9); // train pure LASSO model with 0.1 penalty let model = ElasticNet::params() .penalty(0.1) .l1_ratio(1.0) .fit(&train)?; println!("z score: {:?}", model.z_score()); // validate let y_est = model.predict(&valid); println!("predicted variance: {}", y_est.r2(&valid)?); ```