Skip to content

Commit 66bc471

Browse files
committed
Merge branch 'main' into remove-codeowner
2 parents 3d610b7 + 9a88aa3 commit 66bc471

30 files changed

Lines changed: 1721 additions & 548 deletions

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ repos:
2424
hooks:
2525
- id: isort
2626
args: ["--profile", "black"]
27-
- repo: local
28-
hooks:
29-
- id: codeowners-coverage
30-
name: every file is covered in codeowners
31-
entry: python3 .github/hooks/codeowners-coverage.py
32-
language: system
33-
pass_filenames: false
34-
always_run: true
27+
# - repo: local
28+
# hooks:
29+
# - id: codeowners-coverage
30+
# name: every file is covered in codeowners
31+
# entry: python3 .github/hooks/codeowners-coverage.py
32+
# language: system
33+
# pass_filenames: false
34+
# always_run: true

protossl/datasets/_cinc_dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def __init__(
4040
_path = Path(dataset_path)
4141
df = pd.read_csv(_path / "georgia.csv")
4242
df = df[df["split"] == split]
43+
self._df = df.reset_index(drop=True)
4344

4445
self.source_ids = torch.as_tensor(df["patient_id"].to_numpy())
4546
self.sample_ids = torch.as_tensor(df["ecg_id"].to_numpy())

protossl/datasets/_code15_dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def __init__(
4040
_path = Path(dataset_path)
4141
df = pd.read_csv(_path / "labels.csv")
4242
df = df[df["split"] == split]
43+
self._df = df.reset_index(drop=True)
4344

4445
self.source_ids = torch.as_tensor(df["patient_id"].to_numpy())
4546
self.sample_ids = torch.as_tensor(df["exam_id"].to_numpy())

protossl/datasets/_echonext_dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(
4141
df = pd.read_csv(_path / "EchoNext_metadata_100k.csv")
4242
df = df.rename(columns=mapping)
4343
split_mask = df["split"] == split
44+
self._df = df.loc[split_mask].reset_index(drop=True)
4445
id_df = df.loc[split_mask, ["patient_key", "ecg_key"]].reset_index(drop=True)
4546
label_df = df.loc[split_mask, target_cols].reset_index(drop=True)
4647

protossl/datasets/_mimic_dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def __init__(
4343
_path = Path(dataset_path)
4444
df = pd.read_csv(_path / "ed-ecgs.csv")
4545
df = df[df["split"] == split]
46+
self._df = df.reset_index(drop=True)
4647

4748
self.source_ids = torch.as_tensor(df["subject_id"].to_numpy())
4849
self.sample_ids = torch.as_tensor(df["study_id"].to_numpy())

protossl/datasets/_ptbxl_dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def __init__(
6666
else:
6767
raise ValueError(f"Unknown split: {split}")
6868
df = df[mask]
69+
self._df = df.reset_index(drop=True)
6970

7071
self.source_ids = torch.as_tensor(df["patient_id"].astype(int).to_numpy())
7172
self.sample_ids = torch.as_tensor(df.index.to_numpy())

protossl/datasets/_zzu_dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def __init__(
5757
)
5858
df = get_zzu_dataframe(dataset_path)
5959
df = df[df["split"] == split]
60+
self._df = df.reset_index(drop=True)
6061

6162
self.source_ids = torch.as_tensor(df["Patient_ID"].to_numpy())
6263
self.sample_ids = torch.as_tensor(df["ECG_ID"].to_numpy())

results/audio-results.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
" his = []\n",
5353
" for i in range(n_folds):\n",
5454
" fold_path = Path(fpath.format(i))\n",
55-
" metrics = pd.read_csv(fold_path / model_dir / \"metrics-bootstrapped.csv\", index_col=\"Label\")\n",
55+
" metrics = pd.read_csv(fold_path / model_dir / \"metrics-bootstrapped-v2.csv\", index_col=\"Label\")\n",
5656
" accs.append(metrics.loc[\"Multiclass\", \"Accuracy\"])\n",
5757
" los.append(metrics.loc[\"Multiclass\", \"Accuracy 95% CI (lo)\"])\n",
5858
" his.append(metrics.loc[\"Multiclass\", \"Accuracy 95% CI (hi)\"])\n",
5959
" acc = np.mean(accs)\n",
6060
" lo = np.mean(los)\n",
6161
" hi = np.mean(his)\n",
6262
" else:\n",
63-
" metrics = pd.read_csv(Path(fpath) / model_dir / \"metrics-bootstrapped.csv\", index_col=\"Label\")\n",
63+
" metrics = pd.read_csv(Path(fpath) / model_dir / \"metrics-bootstrapped-v2.csv\", index_col=\"Label\")\n",
6464
" acc = metrics.loc[\"Multiclass\", \"Accuracy\"]\n",
6565
" lo = metrics.loc[\"Multiclass\", \"Accuracy 95% CI (lo)\"]\n",
6666
" hi = metrics.loc[\"Multiclass\", \"Accuracy 95% CI (hi)\"]\n",

0 commit comments

Comments
 (0)