Skip to content

Commit

Permalink
add missing conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
alistairewj committed Nov 19, 2019
1 parent cf8c0e7 commit 055bded
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os

import pytest
import pandas as pd
import numpy as np


@pytest.fixture()
def ovarian_cancer_dataset():
dir_path = os.path.dirname(os.path.realpath(__file__))

data = pd.read_csv(
os.path.join(dir_path, "data", "ovarian_cancer.csv"), index_col="idx"
)

# Unfortunately it's unclear how the missing data was imputed in the article
# We use median imputation here. As such AUROCs are the same but p-values differ.
data.albumin = data.albumin.fillna(np.median(data.albumin.dropna()))
data.total_protein = data.total_protein.fillna(
np.median(data.total_protein.dropna())
)

return data

0 comments on commit 055bded

Please sign in to comment.