OCDocker.OCScore.Utils.StudyParser module

Parse Optuna study metadata and summarize results.

Usage:

import OCDocker.OCScore.Utils.StudyParser as ocstudy

OCDocker.OCScore.Utils.StudyParser.analyze_studies(snames, storage, n_trials=5, verbose=False)[source]

For each study, load trials, filter COMPLETE + dedupe, compute combined_metric = RMSE - AUC, then pull out top-n by RMSE (smallest), top-n by AUC (largest), and top-n by combined_metric (smallest). Ablation studies also get a ‘features’ column. Returns three DataFrames: df_rmse, df_auc, df_combined.

Parameters:
  • snames (list[str]) –

  • storage (str) –

  • n_trials (int) –

  • verbose (bool) –

Return type:

tuple[DataFrame, DataFrame, DataFrame]

OCDocker.OCScore.Utils.StudyParser.analyze_studies_old(snames, storage, n_trials=5, verbose=False)[source]

Analyze the studies and get the n best trials.

Parameters:
  • snames (list[str]) – The list of study names.

  • storage (str) – The storage string for the database.

  • n_trials (int) – The number of trials to get.

  • verbose (bool) – Whether to print the results.

Returns:

The DataFrame with the results.

Return type:

pd.DataFrame

OCDocker.OCScore.Utils.StudyParser.parse_study_type(name, autoencoder=False, genetic_algorithm=False, multiple_autoencoders=False)[source]

Parse the study type from the study name.

Parameters:
  • name (str) – The name of the study.

  • autoencoder (bool, optional) – Whether the study is an autoencoder study. Default is False.

  • genetic_algorithm (bool, optional) – Whether the study is a genetic algorithm study. Default is False.

  • multiple_autoencoders (bool, optional) – Whether the study is a multiple autoencoders study. Default is False.

Returns:

The study type.

Return type:

str