Skip to content

Conversation

@eebaill
Copy link
Contributor

@eebaill eebaill commented Oct 24, 2025

Added sphinx-gallery to the docs

  • Uploaded docs/auto_examples directory containing documentation for examples that are already run
  • Will send a follow-up describing the different configuration options for choosing what examples to run in the gallery

@eebaill eebaill requested a review from bjdebus October 24, 2025 16:10
@eebaill eebaill self-assigned this Oct 24, 2025
@eebaill eebaill linked an issue Oct 24, 2025 that may be closed by this pull request
# Testing data
n_tst = 10000
x_tst = rng.random(n=n_tst) # random numbers in [0,1]^d
y_tst = func(x_tst) + np.random.normal(0, noise_std, size = (n_tst,1))
Copy link
Member

Choose a reason for hiding this comment

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

Why are we adding noise to the test data? I think we should only add noise to the training data, not the testing data.


# Training data
np.random.seed(42)
n_trn = 70
Copy link
Member

Choose a reason for hiding this comment

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

It would be helpful to explain the choice of 70 training points. As BCS is a sparse regression approach, it is designed for the situation where we do not have enough data to fit all basis terms without using regularization.

print("Number of Basis Terms:", len(pce_surr.pcrv.mindices[0]))

# (1.5) Set training data
pce_surr.set_training_data(x_trn, y_trn[:,0])
Copy link
Member

Choose a reason for hiding this comment

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

This data is still defined on [0,1]^d rather than [-1,1]^d. I thought you had reworked this to match the domain of the basis terms. Do I have that wrong?

np.random.seed(42)
n_trn = 70
x_trn = rng.random(n=n_trn) # random numbers in [0,1]^d
y_trn = func(x_trn) + np.random.normal(0, noise_std, size = (n_trn,1))
Copy link
Member

Choose a reason for hiding this comment

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

Does func return a 2-D array?

y_trn_approx = pce_surr.evaluate(x_trn)
y_tst_approx = pce_surr.evaluate(x_tst)

# Evaluate goodness of fit with RMSE
Copy link
Member

Choose a reason for hiding this comment

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

I would move the computation of the RMSE errors below the parity plots. The parity plots already indicate that there is a lot of error in the testing data predictions, and the RMSE then confirms that.

@eebaill
Copy link
Contributor Author

eebaill commented Oct 24, 2025 via email

Copy link
Member

@bjdebus bjdebus left a comment

Choose a reason for hiding this comment

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

approved, per our conversation.

@bjdebus bjdebus merged commit 5c949b6 into main Oct 24, 2025
4 of 5 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.

Add example gallery to Sphinx docs

3 participants