From d4ece6dcb76db007ebecb3cff0b7cfe186c6b441 Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Mon, 25 Mar 2024 13:28:36 +0000 Subject: show formula in cost model display --- src/crates/cli/src/model.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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] + ), + ))), ) })); -- cgit v1.2.3