Skip to content
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
677 changes: 677 additions & 0 deletions graph.ipynb

Large diffs are not rendered by default.

179 changes: 129 additions & 50 deletions main.py

Large diffs are not rendered by default.

Empty file added my_project/README.md
Empty file.
Empty file.
Empty file added my_project/tests/__init__.py
Empty file.
2,716 changes: 2,716 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tool.poetry]
name = "storm_paper_experiments"
version = "0.1.0"
description = ""
authors = ["Your Name <your.email@example.com>"]

[tool.poetry.dependencies]
python = "^3.10"
numpy = "^1.23"
pandas = "^2.0"
scikit-learn = "^1.4"
matplotlib = "^3.7"
seaborn = "^0.12"
ruptures = "^1.1"
jinja2 = "^3.1"
bidict = "^0.22"
numba = "^0.60.0"
statsmodels = "^0.14.3"
keras = "^3.5.0"
tensorflow = "^2.17.0"
tdqm = "^0.0.1"
jsonpickle = "^3.3.0"
ipykernel = "^6.29.5"

[tool.poetry.group.dev.dependencies]
ipykernel = "^6.29.5"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
12 changes: 10 additions & 2 deletions src/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def cutoff_averaged_f_beta(y_dfs, y_preds_dfs, label_filters_for_all_cutoffs, be
all_cutoffs = label_filters_for_all_cutoffs[0].keys()

f_betas = 0
for cutoffs in all_cutoffs:
for cutoffs in all_cutoffs:
filtered_y, filtered_y_preds = filter_label_and_predictions_to_array(y_dfs, y_preds_dfs, label_filters_for_all_cutoffs, cutoffs)
f_betas += fbeta_score(filtered_y, filtered_y_preds, beta=beta)

Expand Down Expand Up @@ -125,7 +125,15 @@ def bootstrap_stats_per_confmat_array(bootstrap_samples, confmat_per_station, be
tn, fp, fn, tp = confmat_sum

metrics[i,0] = tp/(tp+fp)
metrics[i,1] = tp/(tp+fn)
if not (tp+fn)==0:
metrics[i,1] = tp/(tp+fn)
else:
if tp==0:
metrics[i,1]=0
elif tp==fn:
metrics[i,1]=0.5
else:
metrics[i,1]=1
metrics[i,2] = (1+beta**2) * (tp) / ((1+beta**2)*tp + (beta**2)*fn + fp + eps)

mean_metrics = np.zeros((3,), dtype=np.float64)
Expand Down
2 changes: 1 addition & 1 deletion src/helper_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: rbouman
Expand Down
Loading