Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 30, 2024
1 parent b02e7ae commit f73a062
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/create_train_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os

import polars as pl

from utils.functions import load_pickle

parser = argparse.ArgumentParser(description="Create train/val/test split.")
Expand Down
1 change: 1 addition & 0 deletions src/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import torch
from sklearn.model_selection import train_test_split
from torch.utils.data import Dataset

from utils.functions import load_pickle, preview_data


Expand Down
5 changes: 3 additions & 2 deletions src/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import polars as pl
import shap
import toml
from datasets import CollateTimeSeries, MIMIC4Dataset
from fairlearn.metrics import (
MetricFrame,
count,
Expand All @@ -19,7 +18,6 @@
selection_rate,
)
from lightning.pytorch import Trainer
from models import MMModel
from sklearn.metrics import (
accuracy_score,
average_precision_score,
Expand All @@ -28,6 +26,9 @@
)
from torch import concat
from torch.utils.data import DataLoader

from datasets import CollateTimeSeries, MIMIC4Dataset
from models import MMModel
from utils.functions import load_pickle, read_from_txt
from utils.preprocessing import transform_race

Expand Down
3 changes: 2 additions & 1 deletion src/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import numpy as np
import polars as pl
import toml
from datasets import MIMIC4Dataset
from fairlearn.postprocessing import ThresholdOptimizer, plot_threshold_optimizer
from sklearn.metrics import (
accuracy_score,
balanced_accuracy_score,
confusion_matrix,
)

from datasets import MIMIC4Dataset
from utils.functions import load_pickle, read_from_txt

if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions src/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import polars as pl
from tqdm import tqdm

from utils.functions import scale_numeric_features
from utils.preprocessing import (
add_time_elapsed_to_events,
Expand Down
5 changes: 3 additions & 2 deletions src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

import lightning as L
import toml
from datasets import CollateFn, CollateTimeSeries, MIMIC4Dataset
from lightning.pytorch.callbacks import (
EarlyStopping,
LearningRateMonitor,
ModelCheckpoint,
)
from lightning.pytorch.loggers import CSVLogger, WandbLogger
from models import MMModel
from torch.utils.data import DataLoader

from datasets import CollateFn, CollateTimeSeries, MIMIC4Dataset
from models import MMModel
from utils.functions import read_from_txt

if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion src/train_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import numpy as np
import toml
from datasets import MIMIC4Dataset
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import (
accuracy_score,
Expand All @@ -13,6 +12,8 @@
roc_auc_score,
)
from sklearn.model_selection import GridSearchCV

from datasets import MIMIC4Dataset
from utils.functions import read_from_txt

if __name__ == "__main__":
Expand Down

0 comments on commit f73a062

Please sign in to comment.