aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-03-25 13:28:36 +0000
committerAria Shrimpton <me@aria.rip>2024-03-25 13:28:36 +0000
commitd4ece6dcb76db007ebecb3cff0b7cfe186c6b441 (patch)
treec47c0018f5e5c6f8dbb4fc76bf65fb6af1af4074
parentd8cee46d271b9336ddccf4485436845451f9b218 (diff)
show formula in cost model display
-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]
+ ),
+ ))),
)
}));