Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ scripts/4-z-* @StevenSong
scripts/5-1-run-ecgfounder-logreg.sh @StevenSong
scripts/5-2-run-stmem-logreg.sh @StevenSong
scripts/6-run-protossl-heedb-pia.sh @StevenSong
scripts/6-z-* @StevenSong
scripts/7-run-protossl-heedb-pit.sh @StevenSong
scripts/8-run-protossl-heedb-pip.sh @StevenSong
scripts/9-0-run-ecgfounder-patches.sh @StevenSong
Expand Down
1 change: 1 addition & 0 deletions protossl/datasets/_cinc_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
_path = Path(dataset_path)
df = pd.read_csv(_path / "georgia.csv")
df = df[df["split"] == split]
self._df = df.reset_index(drop=True)

self.source_ids = torch.as_tensor(df["patient_id"].to_numpy())
self.sample_ids = torch.as_tensor(df["ecg_id"].to_numpy())
Expand Down
1 change: 1 addition & 0 deletions protossl/datasets/_code15_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(
_path = Path(dataset_path)
df = pd.read_csv(_path / "labels.csv")
df = df[df["split"] == split]
self._df = df.reset_index(drop=True)

self.source_ids = torch.as_tensor(df["patient_id"].to_numpy())
self.sample_ids = torch.as_tensor(df["exam_id"].to_numpy())
Expand Down
1 change: 1 addition & 0 deletions protossl/datasets/_echonext_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(
df = pd.read_csv(_path / "EchoNext_metadata_100k.csv")
df = df.rename(columns=mapping)
split_mask = df["split"] == split
self._df = df.loc[split_mask].reset_index(drop=True)
id_df = df.loc[split_mask, ["patient_key", "ecg_key"]].reset_index(drop=True)
label_df = df.loc[split_mask, target_cols].reset_index(drop=True)

Expand Down
1 change: 1 addition & 0 deletions protossl/datasets/_mimic_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(
_path = Path(dataset_path)
df = pd.read_csv(_path / "ed-ecgs.csv")
df = df[df["split"] == split]
self._df = df.reset_index(drop=True)

self.source_ids = torch.as_tensor(df["subject_id"].to_numpy())
self.sample_ids = torch.as_tensor(df["study_id"].to_numpy())
Expand Down
1 change: 1 addition & 0 deletions protossl/datasets/_ptbxl_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(
else:
raise ValueError(f"Unknown split: {split}")
df = df[mask]
self._df = df.reset_index(drop=True)

self.source_ids = torch.as_tensor(df["patient_id"].astype(int).to_numpy())
self.sample_ids = torch.as_tensor(df.index.to_numpy())
Expand Down
1 change: 1 addition & 0 deletions protossl/datasets/_zzu_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(
)
df = get_zzu_dataframe(dataset_path)
df = df[df["split"] == split]
self._df = df.reset_index(drop=True)

self.source_ids = torch.as_tensor(df["Patient_ID"].to_numpy())
self.sample_ids = torch.as_tensor(df["ECG_ID"].to_numpy())
Expand Down
4 changes: 2 additions & 2 deletions results/audio-results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
" his = []\n",
" for i in range(n_folds):\n",
" fold_path = Path(fpath.format(i))\n",
" metrics = pd.read_csv(fold_path / model_dir / \"metrics-bootstrapped.csv\", index_col=\"Label\")\n",
" metrics = pd.read_csv(fold_path / model_dir / \"metrics-bootstrapped-v2.csv\", index_col=\"Label\")\n",
" accs.append(metrics.loc[\"Multiclass\", \"Accuracy\"])\n",
" los.append(metrics.loc[\"Multiclass\", \"Accuracy 95% CI (lo)\"])\n",
" his.append(metrics.loc[\"Multiclass\", \"Accuracy 95% CI (hi)\"])\n",
" acc = np.mean(accs)\n",
" lo = np.mean(los)\n",
" hi = np.mean(his)\n",
" else:\n",
" metrics = pd.read_csv(Path(fpath) / model_dir / \"metrics-bootstrapped.csv\", index_col=\"Label\")\n",
" metrics = pd.read_csv(Path(fpath) / model_dir / \"metrics-bootstrapped-v2.csv\", index_col=\"Label\")\n",
" acc = metrics.loc[\"Multiclass\", \"Accuracy\"]\n",
" lo = metrics.loc[\"Multiclass\", \"Accuracy 95% CI (lo)\"]\n",
" hi = metrics.loc[\"Multiclass\", \"Accuracy 95% CI (hi)\"]\n",
Expand Down
Loading
Loading