Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rlars
Copy link
Contributor

@rlars rlars commented Nov 19, 2025

Motivation

This PR creates make methods for surrogates, see #663

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

For now, created a test method analogous to the one for make methods for strategies.

@rlars rlars force-pushed the Make_For_Surrogates branch 5 times, most recently from 248f969 to 8e69591 Compare November 20, 2025 08:01
@rlars
Copy link
Contributor Author

rlars commented Nov 20, 2025

Remaining failing tests are due to disk space issue or fail without my changes as well.

@rlars rlars marked this pull request as ready for review November 20, 2025 09:01
@rlars rlars force-pushed the Make_For_Surrogates branch from 8e69591 to ce9a3f1 Compare November 20, 2025 10:49
@rlars rlars force-pushed the Make_For_Surrogates branch from ce9a3f1 to 7eb1e07 Compare November 20, 2025 10:53
@rlars rlars force-pushed the Make_For_Surrogates branch from 7eb1e07 to cd3d122 Compare November 20, 2025 10:56
@rlars rlars force-pushed the Make_For_Surrogates branch from cd3d122 to 3da10b1 Compare November 20, 2025 12:04
@jduerholt jduerholt self-requested a review November 24, 2025 10:17
Copy link
Contributor

@jduerholt jduerholt left a comment

Choose a reason for hiding this comment

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

This looks very nice. Thanks. I only have some minor questions/comments.

def test(surrogate_type: type[SurrogateWithMake], data_model):
if (
type(data_model) in surrogates_skip_all
or type(surrogate_type) in surrogates_skip_all
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this skip things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems I missed to implement make for some surrogates (which at first glance I thought to be used internally only). And there are some more typing issues for certain classes. I will try to fix them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a shortcoming of mapping multiple surrogate data models to the same surrogate. Eventually, the test function could be adapted, but this should go along with improvements to the modelling.

@jduerholt
Copy link
Contributor

Hi @rlars,

just tell me when you are ready, then I rereview.

Best,

Johannes

@rlars rlars force-pushed the Make_For_Surrogates branch 3 times, most recently from 72aa793 to 4537e2c Compare December 8, 2025 14:20
@rlars rlars force-pushed the Make_For_Surrogates branch from 4537e2c to 4ff4eb0 Compare December 8, 2025 14:38
@rlars
Copy link
Contributor Author

rlars commented Dec 8, 2025

Hi @rlars,

just tell me when you are ready, then I rereview.

Best,

Johannes

@jduerholt an you please have another look?
I would squash this before merging, but for now I keep it as is in case I need to do more changes.

@jduerholt
Copy link
Contributor

I will have a look!

Copy link
Contributor

@jduerholt jduerholt left a comment

Choose a reason for hiding this comment

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

Thank you very much! I am a bit puzzled regarding the changes with the hyperconfig, can you comment on this?

Best,

Johannes


hyperconfig: Optional[Hyperconfig] = None

@property
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we setting this not over inheritance?

"""
return isinstance(my_type, type(ContinuousOutput))

def update_hyperparameters(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, why are you moving it outside of the Hyperconfig? Is this necessary?

def _update_hyperparameters(surrogate_data, hyperparameters: pd.Series):
raise NotImplementedError(
"Ideally this would be an abstract method, but this causes problems in pydantic.",
def update_hyperparameters(self, hyperparameters: pd.Series):
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, now I am puzzled, the update is now part of both the config and the actual model?

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