aboutsummaryrefslogtreecommitdiff
path: root/src/crates
diff options
context:
space:
mode:
Diffstat (limited to 'src/crates')
-rw-r--r--src/crates/cli/src/model.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/crates/cli/src/model.rs b/src/crates/cli/src/model.rs
index bb8c367..cfe7f68 100644
--- a/src/crates/cli/src/model.rs
+++ b/src/crates/cli/src/model.rs
@@ -28,8 +28,15 @@ impl State {
est.coeffs
.iter()
.enumerate()
- .map(|(pow, coeff)| (format!("coeff {}", pow), *coeff))
- .chain(once(("nrmse".to_string(), est.nrmse(obvs)))),
+ .map(|(pow, coeff)| (format!("coeff {}", pow), coeff.to_string()))
+ .chain(once(("nrmse".to_string(), est.nrmse(obvs).to_string())))
+ .chain(once((
+ "formula".to_string(),
+ format!(
+ "{} + {}*x + {}*x^2 + {}*log_2 x",
+ est.coeffs[0], est.coeffs[1], est.coeffs[2], est.coeffs[3]
+ ),
+ ))),
)
}));