Predicted target values (non-scaled) for a Gaussian Process model #738
-
Beta Was this translation helpful? Give feedback.
Answered by
AdrianSosic
Feb 4, 2026
Replies: 1 comment 8 replies
-
|
Hi @inogueroles, let me keep it short but with all necessary info:
Here a condensed version of your code that does what you are looking for: import pandas as pd
from baybe.campaign import Campaign
from baybe.constraints import ContinuousLinearConstraint
from baybe.parameters import NumericalContinuousParameter
from baybe.searchspace import SearchSpace
from baybe.targets import NumericalTarget
from baybe.utils.dataframe import create_fake_input
objective = NumericalTarget(name="Target", minimize=True).to_objective()
parameters = [
NumericalContinuousParameter(name="x1", bounds=(0, 100)),
NumericalContinuousParameter(name="x2", bounds=(0, 100)),
NumericalContinuousParameter(name="x3", bounds=(0, 100)),
NumericalContinuousParameter(name="x4", bounds=(0, 100)),
NumericalContinuousParameter(name="x5", bounds=(553, 613)),
NumericalContinuousParameter(name="x6", bounds=(10, 50)),
NumericalContinuousParameter(name="x7", bounds=(12000, 192000)),
NumericalContinuousParameter(name="x8", bounds=(1.5, 4)),
]
constraint = ContinuousLinearConstraint(
parameters=["x1", "x2", "x3", "x4"],
operator="=",
coefficients=[1.0, 1.0, 1.0, 1.0],
rhs=100,
)
searchspace = SearchSpace.from_product(parameters=parameters, constraints=[constraint])
campaign = Campaign(searchspace=searchspace, objective=objective)
# >>>>> Added by me because I don't have your data
df = create_fake_input(campaign.parameters, campaign.targets, n_rows=5)
campaign.add_measurements(df)
# <<<<<
print("Posterior statistics evaluated at the campaign measurements (for comparison):")
print(pd.concat([campaign.measurements, campaign.posterior_stats()], axis=1))
print("Posterior statistics evaluated at the recommendations:")
recommendations = campaign.recommend(5)
print(pd.concat([recommendations, campaign.posterior_stats(recommendations)], axis=1))Let me know if you need more help 👍🏼 |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
AdrianSosic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment





Hi @inogueroles,
let me keep it short but with all necessary info:
boundsusing our old target interface, which I mentioned in my answer to your other thread. As explained there, the bounds probably don't do what you think they do, and you should likely just remove them.posterior_statsmethod, which exactly does the job for you. Have a look here