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

Yahpo blackbox not matching direct calls to yahpo #558

Closed
sighellan opened this issue Feb 17, 2023 · 0 comments · Fixed by #559
Closed

Yahpo blackbox not matching direct calls to yahpo #558

sighellan opened this issue Feb 17, 2023 · 0 comments · Fixed by #559

Comments

@sighellan
Copy link
Contributor

Describe the bug
When not explicitly giving the fidelity in the YAHPO wrapper, we get different values than when calling YAHPO directly. Related to #437, but for when fidelity variable is None

To reproduce

import yahpo_gym
from syne_tune.blackbox_repository import BlackboxRepositoryBackend

yahpo_dataset = '4134'

# syne-tune set-up
backend = BlackboxRepositoryBackend(
                blackbox_name="yahpo-rbv2_svm",
                elapsed_time_attr="timetrain",
                dataset=yahpo_dataset,
                surrogate_kwargs={'fidelities': [1]}
)


# Example config to compare
raw_config = {
    'cost': 1.0,
    'kernel': 'linear',
    'num.impute.selected.cpo': 'impute.mean',
    'task_id': '4134',
    'tolerance': 0.009528896028657764,
    'degree': 4,
    'gamma': 1.0,
    'repl': 10,
    'trainsize': 0.05
}

conf_syne_tune = {hp: raw_config[hp] for hp in raw_config if hp != 'trainsize'}
conf_syne_tune_v2 = {hp: raw_config[hp] for hp in raw_config if hp not in ['trainsize', 'degree', 'gamma']}

conf_yahpo = {hp: raw_config[hp] for hp in raw_config if hp not in ['degree', 'gamma']}

print(backend.blackbox(conf_syne_tune))
print(backend.blackbox(conf_syne_tune_v2))

# YAHPO set-up
bb = yahpo_gym.BenchmarkSet(scenario="rbv2_svm")
bb.set_instance(yahpo_dataset)


print(bb.objective_function(conf_yahpo))

Output:

[[ 1.00000000e+00  1.00000000e+00  1.00000000e+00  1.29179525e+00
  -5.96046448e-08  8.45990071e-05  9.97874737e-02  2.09929701e-02
  -2.62584304e-04]]
[[ 0.65576935  0.62228823  0.67812222  0.21296407  0.61258245  0.68215483
  10.71848392  3.69341993  0.35094392]]
[{'acc': 0.65576935, 'bac': 0.6222882, 'auc': 0.6781222, 'brier': 0.21296407, 'f1': 0.61258245, 'logloss': 0.68215483, 'timetrain': 10.718484, 'timepredict': 3.69342, 'memory': 0.35094392}]

Expected behavior
A clear and concise description of what you expected to happen.

Would expect the metrics to match those of YAHPO.

Paste the output of the pip freeze command below:

Desktop (please complete the following information):

  • OS: [e.g. MacOS Monterey 12.6.1 / Ubuntu Linux / Windows 11]
  • Syne Tune Version main (5ccdef4)

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

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 a pull request may close this issue.

1 participant