This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(len(studies)): | |
study = studies[i] | |
print("Study " + str(i)) | |
for j in range(len(study.trials)): | |
state = str(study.trials[j].state)[11:] | |
if state == "COMPLETE": | |
sqs = study.trials[j].values[0] | |
print("\tTrial " + str(j) + " has state " + state + " and SQS " + str(sqs)) | |
else: | |
print("\tTrial " + str(j) + " has state " + state) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
datasets = pd.read_csv(dataset_list) | |
studies = [] | |
for i in range(len(datasets)): | |
dataset = datasets.loc[i]["filename"] | |
study_name = study_base_name + str(i) | |
studies.append(create_study(study_name, dataset, trial_job_cnt, trials_per_job, api_key, storage, sampler)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
def create_study(study_name, dataset, trial_job_cnt, trials_per_job, api_key, storage, sampler): | |
study = optuna.create_study(study_name=study_name,storage=storage, sampler=sampler, direction="maximize") | |
# Tell Optuna to start with our default config settings | |
study.enqueue_trial( | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from smart_open import open | |
import yaml | |
with open("https://raw.githubusercontent.com/gretelai/gretel-blueprints/main/config_templates/gretel/synthetics/default.yml", 'r') as stream: | |
config = yaml.safe_load(stream) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import optuna | |
from gretel_client import projects | |
from gretel_client import create_project | |
from gretel_client.config import RunnerMode | |
from gretel_client.helpers import poll | |
def objective(trial: optuna.Trial): |