Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Aarhus-Psychiatry-Research/t2d-feature-generation

Repository files navigation

Feature generation for the PSYCOP T2D project

python versions Code style: black [Tests][tests]

This is application scripts for feature generation for the T2D project.

Main functionality lies in psycop-feature-generation and timeseriesflattener.

Installation

pip install --src ./src -r requirements.txt

This will install the requirements in your src folder as their own repos.

For example, this means that it install the timeseriesflattener repository in src/timeseriesflattener. You can make edits there, checkout to a new branch, and submit PRs to the timeseriesflattener repo - all within the VS Code editor.

image

Usage

  1. Use the template

image

  1. Open up application/main.py.
  2. Change the project name in the call to get_project_info
  3. Update the arguments to create_flattened_dataset to fit your situation
  4. Update feature specs in modules/specify_features.py Whichever featuers you specify will need a corresponding loader which returns the raw values for flattening.

Note that there are quite a few loaders in /src/psycop-feature-generation/src/psycop_feature_generation/loaders. Definitely use them as much as possibl to build and fix together.

Also, if you need to add loaders that are likely to generalise, feel free to add them here. If they are specific to your project, add them to modules/loaders/your_loader_file.py.

  1. Generate with a tiny set of features (keep FeatureSpecifier's min_set_for_debug as True.
  2. When everything works, set min_set_for_debug to False and generate a full data set!

Before publication

  • Lock the dependencies in requirements.txt to a specific version