From 1bff90b1cbad15b221179366d7b347a1feb76683 Mon Sep 17 00:00:00 2001 From: Winston Ewert Date: Mon, 4 Mar 2019 10:25:06 -0800 Subject: [PATCH] add ability to set parameters on linear regression model --- src/learning/lin_reg.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/learning/lin_reg.rs b/src/learning/lin_reg.rs index d376a20b..fb39ac56 100644 --- a/src/learning/lin_reg.rs +++ b/src/learning/lin_reg.rs @@ -55,6 +55,11 @@ impl Default for LinRegressor { } impl LinRegressor { + /// Create a new linear regression model from parameters + pub fn new(parameters: Option>) -> LinRegressor { + LinRegressor { parameters } + } + /// Get the parameters from the model. /// /// Returns an option that is None if the model has not been trained.