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

classification.py dumps data to unwanted location #845

Open
aorgazf opened this issue May 15, 2024 · 0 comments · May be fixed by #1086
Open

classification.py dumps data to unwanted location #845

aorgazf opened this issue May 15, 2024 · 0 comments · May be fixed by #1086

Comments

@aorgazf
Copy link
Member

aorgazf commented May 15, 2024

Hi,
the train_qubit method of qibocal/fitting/classifier/run.py, called as part of protocols.characterization.classification dumps data to the folder used to launch the script:

base_dir = pathlib.Path()
...

def train_qubit(
    cls_data,
    qubit: QubitId,
):
    r"""Given a dataset `qubits_data` with qubits' information, this function performs the benchmarking of some classifiers.
    Each model's prediction `y_pred` is saved in  `basedir/qubit{qubit}/{classifier name}/predictions.npy`.

    Args:
        base_dir (path): Where save the results.
        qubit (int): Qubit ID.
        qubits_data (DataFrame): data about the qubits` states.
        classifiers (list | None, optional): List of classification models. It must be a subset of `CLS_MODULES`.

    Returns:
        - benchmarks_table (pd.DataFrame): Table with the following columns

            - **name**: model's name
            - **accuracy**: model's accuracy
            - **training_time**: training time in seconds
            - **testing_time**: testing time per item in seconds.

        - y_test (list): List of test outputs.
        - x_test (list): Tests inputs.
        - models (list): List of trained models.
        - Names (list): Models' names
        - hpars_list(list): Models' hyper-parameters.

    """
    qubit_dir = base_dir / f"qubit{qubit}"

the data should be saved within the output folder identified by the user when calling qibocal.
Please note that the docstring of the train_qubit needs to be updated.

I believe that, in order to address this issue, #533 should be addressed first.

@andrea-pasquale andrea-pasquale linked a pull request Feb 14, 2025 that will close 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

Successfully merging a pull request may close this issue.

1 participant