Skip to content
Snippets Groups Projects
Commit c3f4b10b authored by Ryan Godwin's avatar Ryan Godwin
Browse files

A few updates to get the png plots saved...

seems it won't save the png + html as creating one seems to destry the plot
parent 7bfd32ac
No related branches found
No related tags found
1 merge request!1Progress toward getting the evaluation integrated
......@@ -27,7 +27,7 @@ warnings.filterwarnings("ignore")
def extract_ic_from_meg(
args_fp: str = "config/args_meg_preproc.json",
experiment_name: str = experiment_name,
run_name: str = "Run1",
run_name: str = "extract_ica_from_meg",
test_run: bool = False,
) -> None:
"""
......@@ -96,7 +96,7 @@ def extract_ic_from_meg(
def label_cardiac_ic(
args_fp: str = "config/args_meg_preproc.json",
experiment_name: str = experiment_name,
run_name: str = "sgd",
run_name: str = "label_cardiac_ic",
test_run: bool = False,
) -> None:
"""
......@@ -137,23 +137,23 @@ def label_cardiac_ic(
output_png = Path(config.INTERMEDIATE_DIR, fp.parent.name, "Heartifact.png")
plot_cardiac_ic = PlotCardiacIC(
output_file=output_png, x_values=df[time_col], y_values=df[IC_col]
output_file=output_png.absolute(), x_values=df[time_col], y_values=df[IC_col]
)
html_plot_out = plot_cardiac_ic()
plot_out = plot_cardiac_ic()
mlflow.set_experiment(experiment_name)
with mlflow.start_run(run_name=run_name) as run:
run_id = mlflow.active_run().info.run_id
mlflow.log_params(args)
mlflow.log_artifact(html_plot_out)
mlflow.log_artifact(plot_out)
mlflow.log_artifact(output_png)
open(Path(config.CONFIG_DIR, "run_id.txt"), "w", encoding="utf-8").write(run_id)
@app.command()
def preprocess_ecgs(
experiment_name: str = "Preprocess ECG Data",
run_name: str = "preprocess 1",
experiment_name: str = experiment_name,
run_name: str = "preprocess ECG",
test_run: bool = True,
):
ecg_scan_folders = get_data.get_folders(config.ECG_DATA_DIR, ".txt")
......@@ -171,8 +171,7 @@ def preprocess_ecgs(
scaled_ecg = scaler.fit_transform(ecg_dat)
print(scaled_ecg)
# Add standard scaling and baseline correction
@app.command()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment