Skip to content

Commit

Permalink
Latest scale up batch (#150)
Browse files Browse the repository at this point in the history
* update dependencies

* Update data export and config

* Updated last agendas and query

* Updated model

* Update Changelog

* Set max version of sklearn

* Fix leading zero's in subagenda

* Update manifest and pyproject to python 3.12

* Update GH actions and pyproject
  • Loading branch information
rubenpeters91 authored Dec 12, 2024
1 parent 2ba5e2b commit 7518823
Show file tree
Hide file tree
Showing 20 changed files with 224 additions and 106 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: uv sync --only-dev
run: uv sync --only-group lint

- name: Analysing the code with ruff
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: uv sync --all-extras --dev
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.5.0] - 2024-12-10

### Changed
- Upgraded to Python 3.12 and updated all dependencies
- Retrained model on all clinics

### Added
- Added last batch of agandas to config

## [1.4.11] - 2024-12-03

### Changed
Expand Down
4 changes: 2 additions & 2 deletions data/raw/poliafspraken_no_show.csv.dvc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
outs:
- md5: 31983d8a20d487417a9da7cf024c7ecc
size: 487004530
- md5: e33284ae4e740e652ca682f1d6c78fc5
size: 806485792
path: poliafspraken_no_show.csv
hash: md5
38 changes: 37 additions & 1 deletion data/sql/data_export.sql
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,43 @@ WHERE 1=1
-- Hoofd Hals oncologie
'ZH0027', -- B&O KNH oncologie
-- Functie KNF
'ZH0175' -- Functie KNF
'ZH0175', -- Functie KNF
-- Orthopedie
'ZH0210', -- Orthopedie
-- Urologie
'ZH0324', -- Urologie
-- Plastische chirurgie
'ZH0213', -- Plastische Chirurgie
-- Traumatologie Heelkunde
'ZH0343', -- Traumatologie
'ZH0117', -- Heelkunde
-- Vaatchirurgie
'ZH0401', -- Vaatcentrum
-- KNO
'ZH0178', -- KNO
-- Functiecentrum KNO
'ZH0104', -- Functiecentrum KNO
-- MKA
'ZH0026', -- B&O Kaakchirurgie en oncologie
'ZH0191', -- Mondziekten / kaakchirugie
-- Bijzondere tandheelkunde
'ZH0002', -- A&G
'ZH0014', -- Bijzondere tandheelkunde
-- Oogheelkunde
'ZH0208', -- Oogheelkunde
'CS0140', -- Functie oogheelkunde
-- Anesthesiologie
'ZH0010', -- Anesthesiologie
-- Pijncentrum
'ZH0211', -- Pijnbehandeling
-- Genetica
'ZH0110', -- Genetica
'ZH0160', -- Kind-ontwikkelingsachterstand
-- Prikpoli
'020434', -- Kind-laboratorium
'ZH0414', -- VAS-teamagenda
-- Fertiliteit & gyneacologie
'ZH04222' -- Voortplanting & gynaecologie
)
AND APP.identifier_system = 'https://metadata.umcutrecht.nl/ids/HixAgendaAfspraak'
AND APP.created >= '2016-01-01'
Expand Down
76 changes: 74 additions & 2 deletions data/sql/data_prediction.sql
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,43 @@ WHERE 1=1
-- Hoofd Hals oncologie
'ZH0027', -- B&O KNH oncologie
-- Functie KNF
'ZH0175' -- Functie KNF
'ZH0175', -- Functie KNF
-- Orthopedie
'ZH0210', -- Orthopedie
-- Urologie
'ZH0324', -- Urologie
-- Plastische chirurgie
'ZH0213', -- Plastische Chirurgie
-- Traumatologie Heelkunde
'ZH0343', -- Traumatologie
'ZH0117', -- Heelkunde
-- Vaatchirurgie
'ZH0401', -- Vaatcentrum
-- KNO
'ZH0178', -- KNO
-- Functiecentrum KNO
'ZH0104', -- Functiecentrum KNO
-- MKA
'ZH0026', -- B&O Kaakchirurgie en oncologie
'ZH0191', -- Mondziekten / kaakchirugie
-- Bijzondere tandheelkunde
'ZH0002', -- A&G
'ZH0014', -- Bijzondere tandheelkunde
-- Oogheelkunde
'ZH0208', -- Oogheelkunde
'CS0140', -- Functie oogheelkunde
-- Anesthesiologie
'ZH0010', -- Anesthesiologie
-- Pijncentrum
'ZH0211', -- Pijnbehandeling
-- Genetica
'ZH0110', -- Genetica
'ZH0160', -- Kind-ontwikkelingsachterstand
-- Prikpoli
'020434', -- Kind-laboratorium
'ZH0414', -- VAS-teamagenda
-- Fertiliteit & gyneacologie
'ZH04222' -- Voortplanting & gynaecologie
)
AND APP.identifier_system = 'https://metadata.umcutrecht.nl/ids/HixAgendaAfspraak'
AND APP.[created] >= '2015-01-01'
Expand Down Expand Up @@ -268,7 +304,43 @@ WHERE 1=1
-- Hoofd Hals oncologie
'ZH0027', -- B&O KNH oncologie
-- Functie KNF
'ZH0175' -- Functie KNF
'ZH0175', -- Functie KNF
-- Orthopedie
'ZH0210', -- Orthopedie
-- Urologie
'ZH0324', -- Urologie
-- Plastische chirurgie
'ZH0213', -- Plastische Chirurgie
-- Traumatologie Heelkunde
'ZH0343', -- Traumatologie
'ZH0117', -- Heelkunde
-- Vaatchirurgie
'ZH0401', -- Vaatcentrum
-- KNO
'ZH0178', -- KNO
-- Functiecentrum KNO
'ZH0104', -- Functiecentrum KNO
-- MKA
'ZH0026', -- B&O Kaakchirurgie en oncologie
'ZH0191', -- Mondziekten / kaakchirugie
-- Bijzondere tandheelkunde
'ZH0002', -- A&G
'ZH0014', -- Bijzondere tandheelkunde
-- Oogheelkunde
'ZH0208', -- Oogheelkunde
'CS0140', -- Functie oogheelkunde
-- Anesthesiologie
'ZH0010', -- Anesthesiologie
-- Pijncentrum
'ZH0211', -- Pijnbehandeling
-- Genetica
'ZH0110', -- Genetica
'ZH0160', -- Kind-ontwikkelingsachterstand
-- Prikpoli
'020434', -- Kind-laboratorium
'ZH0414', -- VAS-teamagenda
-- Fertiliteit & gyneacologie
'ZH04222' -- Voortplanting & gynaecologie
)
AND APP2.identifier_system = 'https://metadata.umcutrecht.nl/ids/HixAgendaAfspraak'
AND CONVERT(DATE, APP2.[start]) = @start_date
Expand Down
24 changes: 12 additions & 12 deletions dvc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ stages:
deps:
- path: data/processed/featuretable.parquet
hash: md5
md5: 4e754146b5f7ea804ab79691e19038d4
size: 100497640
md5: 752b4606058923722d7d1538bcebc2e6
size: 168033517
- path: src/noshow/model/train_model.py
hash: md5
md5: 12587629eddb081d94bc997c8d100dd4
size: 3713
md5: 1bb5e77bbacc1e4201645258a982d9b8
size: 3959
outs:
- path: output/models/no_show_model_cv.pickle
hash: md5
md5: dfc2275999ae50e74a9ab8459372ddfa
size: 1939776
md5: 5e3f9c01e77a3d4dac17faf920c83ad7
size: 1952898
feature_building:
cmd: python src/noshow/features/feature_pipeline.py
deps:
Expand All @@ -24,14 +24,14 @@ stages:
size: 279455
- path: data/raw/poliafspraken_no_show.csv
hash: md5
md5: 31983d8a20d487417a9da7cf024c7ecc
size: 487004530
md5: e33284ae4e740e652ca682f1d6c78fc5
size: 806485792
- path: src/noshow/features/feature_pipeline.py
hash: md5
md5: 71ffb7a162976bde11e0aed72ea19f98
size: 2889
md5: d6364f3b0671017318366eab08084f0f
size: 3137
outs:
- path: data/processed/featuretable.parquet
hash: md5
md5: 4e754146b5f7ea804ab79691e19038d4
size: 100497640
md5: 752b4606058923722d7d1538bcebc2e6
size: 168033517
2 changes: 1 addition & 1 deletion manifest_admin_dash.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entrypoint": "run/admin_dash.py"
},
"python": {
"version": "3.11.10",
"version": "3.12.6",
"package_manager": {
"name": "pip",
"version": "23.3.1",
Expand Down
2 changes: 1 addition & 1 deletion manifest_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entrypoint": "run.app:app"
},
"python": {
"version": "3.11.10",
"version": "3.12.6",
"package_manager": {
"name": "pip",
"version": "23.3.1",
Expand Down
2 changes: 1 addition & 1 deletion manifest_dash.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entrypoint": "run/calling_dash.py"
},
"python": {
"version": "3.11.10",
"version": "3.12.6",
"package_manager": {
"name": "pip",
"version": "23.3.1",
Expand Down
10 changes: 5 additions & 5 deletions output/dvclive/metrics.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"best_score": 0.7480471226772029,
"mean_roc_auc": 0.7480471226772029,
"std_roc_auc": 0.005831461640562374,
"mean_precision": 0.5541110092343222,
"mean_recall": 0.014451354691335214
"best_score": 0.7555489720970228,
"mean_roc_auc": 0.7555489720970228,
"std_roc_auc": 0.0038171109326925416,
"mean_precision": 0.5476698499321399,
"mean_recall": 0.010038742023701001
}
2 changes: 1 addition & 1 deletion output/dvclive/plots/metrics/best_score.tsv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
step best_score
0 0.7480471226772029
0 0.7555489720970228
2 changes: 1 addition & 1 deletion output/dvclive/plots/metrics/mean_precision.tsv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
step mean_precision
0 0.5541110092343222
0 0.5476698499321399
2 changes: 1 addition & 1 deletion output/dvclive/plots/metrics/mean_recall.tsv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
step mean_recall
0 0.014451354691335214
0 0.010038742023701001
2 changes: 1 addition & 1 deletion output/dvclive/plots/metrics/mean_roc_auc.tsv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
step mean_roc_auc
0 0.7480471226772029
0 0.7555489720970228
2 changes: 1 addition & 1 deletion output/dvclive/plots/metrics/std_roc_auc.tsv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
step std_roc_auc
0 0.005831461640562374
0 0.0038171109326925416
39 changes: 16 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,53 @@ build-backend = "setuptools.build_meta"

[project]
name = "noshow"
version = "1.4.11"
version = "1.5.0"
authors = [
{ name="Ruben Peters", email="[email protected]" },
{ name="Eric Wolters", email="[email protected]" }
]
description = "No-show prediction model to reduce the amount of no-shows at the clinics"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.12"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
dependencies =[
"pandas~=2.0",
"matplotlib~=3.7",
"numpy~=1.24",
"scikit-learn~=1.3",
"pyarrow~=14.0",
"numpy>=1.24",
"scikit-learn>=1.3,<1.7",
"pyarrow>=14.0",
"fastapi~=0.109",
"dvc~=3.33",
"dvclive~=3.41",
"sqlalchemy~=2.0",
"python-dotenv~=1.0",
"pymssql~=2.2",
"streamlit~=1.30",
"streamlit>=1.30",
"tomli~=2.0",
"relplot>=1.0",
]

[project.optional-dependencies]
test = ["pytest", "pytest-cov", "pytest-asyncio"]
dev = ["rsconnect-python", "uvicorn", "nbstripout", "ipykernel"]

[tool.rye]
dev-dependencies = [
"ipykernel>=6.29.2",
"pytest>=8.0.1",
"nbstripout>=0.7.1",
"uvicorn~=0.28.0",
"pytest-asyncio~=0.23.6",
]

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"ipykernel>=6.29.2",
"pytest>=8.0.1",
"nbstripout>=0.7.1",
"uvicorn~=0.28.0",
"pytest-asyncio~=0.23.6",
"uvicorn>=0.28.0",
"pytest-asyncio>=0.23.6",
"pytest-cov>=5.0.0",
"alembic>=1.13.3",
"rsconnect-python>=1.24.0",
]
lint = [
"ruff>=0.7.1",
]

[tool.uv]
default-groups = ["dev", "lint"]

[tool.isort]
profile = "black"

Expand Down
Loading

0 comments on commit 7518823

Please sign in to comment.