Skip to content

fix reg equation and optimizer e-notation#445

Merged
JohnnyDoorn merged 4 commits intojasp-stats:masterfrom
JohnnyDoorn:fix-equation-e-notation
Mar 20, 2026
Merged

fix reg equation and optimizer e-notation#445
JohnnyDoorn merged 4 commits intojasp-stats:masterfrom
JohnnyDoorn:fix-equation-e-notation

Conversation

@JohnnyDoorn
Copy link
Contributor

@juliuspfadt
Copy link
Contributor

can you fix the test? Or maybe just a rebase since the tests in your last PR that we merged yesterday ran fine.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes formatting issues in the DOE analysis output, targeting incorrect regression-equation rendering and scientific-notation (“e-notation”) leakage in Response Optimizer results (per external-issues/#4).

Changes:

  • Adjust regression equation string construction to use formatC() rather than round() when embedding coefficients.
  • Rework Response Optimizer “Solution” and “Optimization Plot Summary” tables to explicitly define predictor + fitted-response columns and to populate them without cbind() coercion.

R/doeAnalysis.R Outdated
Comment on lines +1026 to +1032
tb$addColumnInfo(name = "desi", title = "Composite desirability", type = "number")
for (pred in allPredictors) {
predType <- if (pred %in% continuousPredictors) "number" else "string"
tb$addColumnInfo(name = pred, title = pred, type = predType)
}
for (dep in roDependent)
tb$addColumnInfo(name = paste0(dep, " fit"), title = paste0(dep, " fit"), type = "number")
@juliuspfadt
Copy link
Contributor

also I am not sure of the copilot notes are justified

JohnnyDoorn and others added 2 commits March 20, 2026 12:46
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@JohnnyDoorn JohnnyDoorn force-pushed the fix-equation-e-notation branch from a9366cd to 7546f6b Compare March 20, 2026 11:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes DOE regression equation formatting and improves Response Optimizer table column definitions to address display issues reported in external issue #4.

Changes:

  • Updated regression equation string construction to use formatC() (aim: preserve small coefficients via scientific notation).
  • Reworked Response Optimizer “Solution” and “Optimization Plot Summary” tables to explicitly add predictor + fitted-response columns instead of relying on cbind() side-effects.

@juliuspfadt
Copy link
Contributor

looking at the failed tests, it seems like original values are better than the new ones.

Copy link
Contributor

@juliuspfadt juliuspfadt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just the test should be passing.

@juliuspfadt juliuspfadt self-requested a review March 20, 2026 12:53
Copy link
Contributor

@juliuspfadt juliuspfadt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oopsie, meant to request changes

@JohnnyDoorn
Copy link
Contributor Author

ehh yea i'm currently working on this!

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.94%. Comparing base (b31e734) to head (ddb543e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
R/doeAnalysis.R 96.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #445      +/-   ##
==========================================
+ Coverage   84.86%   84.94%   +0.07%     
==========================================
  Files          18       18              
  Lines        9953     9975      +22     
==========================================
+ Hits         8447     8473      +26     
+ Misses       1506     1502       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JohnnyDoorn JohnnyDoorn merged commit 1fa5cc5 into jasp-stats:master Mar 20, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants