Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
# Run ruff:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.0
rev: v0.7.4
hooks:
# Run the linter.
- id: ruff
Expand All @@ -21,7 +21,7 @@ repos:

# Add pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
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