/psycop-model-evaluation

Model evaluation utilities for the PSYCOP projects

Primary LanguagePythonMIT LicenseMIT

PSYCOP model evaluation

Tests Black

Collection of model evaluations for the PSYCOP project.

The repository is structured like:

src/psycop_model_evaluation
├── base_charts.py                            # General charts, e.g. a generic "scatter" chart.
├── binary                                    # Evaluations of binary classification
│   ├── global_performance                    # E.g. precision_recall and roc_auc
│   ├── performance_by_true_positive_rate.py  # Performance for given thresholds
│   ├── subgroups                             # Subgroups analyses, e.g. age and sex
│   └── time                                  # Time analyses. 
│                                             # Absolute (how we usually think of time) 
│                                             # Periodic (e.g. day of week, week of year) and 
│                                             # Timedelta (e.g. time from first visit)
│ 
├── feature_importance                        # Feature importance
│   ├── feature_importance_table.py
│   └── sklearn
│       └── feature_importance.py
├── time_to_event                             # Evaluations for time to event
└── utils.py

Installation

You can install PSYCOP model evaluation into your src directory by:

pip install --src ./src -e git+https://github.com/Aarhus-Psychiatry-Research/psycop-model-evaluation#egg=psycop_model_evaluation

And when adding it to your dependencies in your pyproject.toml:

  "psycop-model-evaluation @ git+https://github.com/Aarhus-Psychiatry-Research/psycop-model-evaluation#egg=psycop_model_evaluation",

Usage

For an example use case, see t2d-baseline-paper.