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

Task column missing from ExplorationDiagnostics.history dataframe #223

Open
VadimBim opened this issue Jun 13, 2024 · 1 comment
Open

Task column missing from ExplorationDiagnostics.history dataframe #223

VadimBim opened this issue Jun 13, 2024 · 1 comment
Assignees

Comments

@VadimBim
Copy link
Contributor

Hi ! I am using the latest release, 0.6.0, installed with pip.

When trying to execute the first cell from the Analyzing results notebook with the exploration directory obtained from Multitask optimization example I encountered the following error message:

Traceback (most recent call last):
  File "multitask_lpa_fbpic_waket/debug.py", line 3, in <module>
    diags = ExplorationDiagnostics(
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "miniforge3/envs/wake-t/lib/python3.11/site-packages/optimas/diagnostics/exploration_diagnostics.py", line 70, in __init__
    exploration = self._create_exploration(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "miniforge3/envs/wake-t/lib/python3.11/site-packages/optimas/diagnostics/exploration_diagnostics.py", line 105, in _create_exploration
    return Exploration(
           ^^^^^^^^^^^^
  File "miniforge3/envs/wake-t/lib/python3.11/site-packages/optimas/explorations/base.py", line 126, in __init__
    self._load_history(history, resume)
  File "miniforge3/envs/wake-t/lib/python3.11/site-packages/optimas/explorations/base.py", line 493, in _load_history
    self.attach_evaluations(history)
  File "miniforge3/envs/wake-t/lib/python3.11/site-packages/optimas/explorations/base.py", line 405, in attach_evaluations
    raise ValueError(
ValueError: The given data contains the fields ['ax_trial_type', 'ax_arm_name', 'task', 'ax_trial_index'], which are unknown to the generator. If this is expected, ignore them by setting `ignore_unrecognized_parameters=True`.

With the latest version of optimas from GitHub it worked because ignore_unrecognized_parameters=True in self.attach_evaluations line 502 file optimas/explorations/base.py. However, diags.history DataFrame doesn't contain a task column, which is of interest for me.

I managed to obtain this column as follows:

import numpy as np
from optimas.utils.other import convert_to_dataframe

history = np.load("./exploration/exploration_history_after_sim_24.npy")
evaluations = convert_to_dataframe(history)
evaluations['task']

I find it more convenient if this column would be included directly in diags.history. What do you think?

@RemiLehe
Copy link
Collaborator

RemiLehe commented Aug 1, 2024

@delaossa Would you know how to fix this issue?

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

No branches or pull requests

3 participants