Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mse for least squares PCE #128

Merged
merged 11 commits into from
Sep 5, 2023
Merged

Fix mse for least squares PCE #128

merged 11 commits into from
Sep 5, 2023

Conversation

andreaperin
Copy link
Collaborator

The evaluation of the mse of PCE with "least squared" method was performed without the division by the number of samples.

@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b3130d5) 99.06% compared to head (cb91530) 99.06%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #128   +/-   ##
=======================================
  Coverage   99.06%   99.06%           
=======================================
  Files          23       23           
  Lines         852      852           
=======================================
  Hits          844      844           
  Misses          8        8           
Files Changed Coverage Δ
src/models/pce/polynomialchaosexpansion.jl 98.30% <100.00%> (ø)

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

@FriesischScott FriesischScott changed the title PCE - mse evaluation Fix mse for least squares PCE Aug 29, 2023
@FriesischScott
Copy link
Owner

Can you rebase you commit on master so the history is correct? The solver stuff was already merged in a previous PR.


@test mean(pce) ≈ -1.5 rtol = 1e-10
@test var(pce) ≈ 0.5 rtol = 1e-10
@test isapprox(mse, 3e-30, atol=1e-10)
Copy link
Owner

Choose a reason for hiding this comment

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

This is not an adequate test for the mse. You need to get the y values from the returned samples and compare them to evaluate!(pce, copy_of_samples) with copy_of_samples = samples[:, Not(:y)].

@FriesischScott FriesischScott merged commit 8429fcb into FriesischScott:master Sep 5, 2023
7 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.

2 participants