Skip to content

Commit

Permalink
[All] Cleaned code
Browse files Browse the repository at this point in the history
  • Loading branch information
YanSte committed Aug 29, 2023
1 parent 0003970 commit 8dc3723
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/skit/dataset.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import os
import shutil
from tqdm import tqdm
import numpy as np
import h5py
import pandas as pd

from sklearn.model_selection import StratifiedKFold
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor, as_completed
from skit.utils import rmdir

from skit.config import IS_TENSORFLOW_IMPORTED

# ==============================
Expand Down Expand Up @@ -213,11 +215,6 @@ def rescale_dataset(*data, scale=1):
out = [ d[:int(scale*len(d))] for d in data ]
return out[0] if len(out)==1 else out



from sklearn.model_selection import StratifiedKFold
import pandas as pd

def stratifiedTrainValidSplit(df, x_feature_columns, y_target_columns, num_splits=5, selected_fold=1, seed=None, shuffle=True):
"""
Splits the DataFrame into training and validation sets using Stratified K-Folds
Expand Down
3 changes: 2 additions & 1 deletion src/skit/dicom.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from skit.config import IS_PYDICOM_IMPORTED
import subprocess

from skit.config import IS_PYDICOM_IMPORTED

def install_pydicom_library():
result = subprocess.run(['pip', 'install', '-q','pydicom'])
if result.returncode == 0:
Expand Down

0 comments on commit 8dc3723

Please sign in to comment.