miriamkw / glupredkit Goto Github PK
View Code? Open in Web Editor NEWGluPredKit aims to make blood glucose model training and prediction more accessible.
License: MIT License
GluPredKit aims to make blood glucose model training and prediction more accessible.
License: MIT License
Add nighscout parser:
Tidepool and nighscout:
Other
Lets do the plotting stuff in ipython notebooks, no? Then the plots will be visible in GitHub for all to see, among other benefits.
Enhance the generate_config command in the CLI:
The solution can be to give explanatory error messages immediately after an input error, and reprompting the input field to let users try again from where they left off.
Add a command line interface used to
Tasks remaining to finish the tool:
We will build heavily on the benchmarkpaper for this tool, to test it on real life scenarios.
Preparations
Parsers
Summary: All the parsers should do the same: return a "raw dataframe" with all of the datatypes in the same time grid, but without any fuzz.
Preprocessors
Models
Evaluation
Real-time plots:
Settings
Command line interface
Documentation
Code improvements (feedback from chatgpt):
The scripts run very slowly, and some optimisation should be performed in:
Before we start on this we should measure which processes that are most time consuming.
Add metrics:
Find a solution to more elegantly handle glucose units mmol/L vs mg/dL
Keep working on the loop algorithm branch:
Update the repo to use whole trajectories in model training.
How it works now:
Data goes through a preprocessor that adds one target column (given by the prediction horizon). Then, for each prediction horizon, one model is trained. Models assume that there is a target column named "target", and will use this name convention to "find" the target.
My thoughts about the refactor:
The install steps are outlined in clear enough terms in the readme - no reason the user should have to do each thing independently. Let's make a manual install.sh script (idk if this is the best name, but it will be a bash script), that runs everything at once and/or in chunks as needed by setup.py. This will also be useful for organizational purposes when we make the whole thing installable via pip, which it looks like you've started with (b/c you have setup.py).
GluPredKit refactor for enhanced and strict model evaluation:
Refactor:
Configuration:
Generate pdf reports for model evaluation:
Models:
Parsers:
Metrics:
Testing:
General improvements:
Checklist before merge
Jupyter notebook (?):
Further work:
The repository should have a new name - more descriptive of the purpose which is to evaluate any kind of blood glucose prediction based on any kind of penalty function. Suggestions:
The forward method in lstm pytorch should not be squeesed. this leads to the error: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
Add a possibility in the scatter plot to allow/disallow certain models so you can interactively choose which models to compare.
My understanding is that the apple_health parser should instead take a filename as an argument, but it complains that no USERNAME is supplied:
Line 72 in d8ee553
To enhance usability even further, do the following:
The first step to make sure that we are using pyloopkit correctly and fetching correct predictions, is to run the example_nightscout.py
and verify with out Loop app in real time. Currently the predictions are slightly off.
Possible solutions:
Currently, the trajectories plot is cutting off all predictions that dont have corresponding measurements to all of the trajectory. Should this be changed?
Currently in the generate_config command, it is only possible to use the promts to generate configurations. It should also be an option to generate configs programmatically.
The pip install of GluPredKit does not create an executable entry point.
I have:
#!/usr/bin/env python3
to cli.pychmod +x glupredkit/cli.py
setup.py
Resources:
Currently there is configuration for that data processing. This configuration may be used with any model.
However, models might also have many different configurations, like hyperparameters or therapy settings. These can be cumbersome to define in a CLI, and should probably be added as configuration files as well.
This means a refactor that:
Handle units:
y_pred, y_true consistency In models, metrics etc:
rename repository:
Adjusting GluPredKit to pave the way for making "what-if"-events the common choice in model training:
Create a helper class for preprocessing:
Will make adoption WAY easier if in the readme we can just say
pip install glupredkit
or pip install git+git://github.com/miriamkw/GluPredKit
This involves a few steps
Basic tutorial: https://packaging.python.org/tutorials/packaging-projects/ that includes these steps.
We should make sure it works via pip install glupredkit
as well as pip install git+git://github.com/miriamkw/GluPredKit
, probably w/ initial emphasis in the second one, since that doesnt require doing any uploads to pypi. People will use this both to gain access to the framework within python and from the command line. So python -m glupredkit <command>
will become glupredkit <command>
.
Ohio T1DM fixes:
Helper methods/classes to process data:
Evaluator:
Prediction models:
tidepool_parser.py
:
tidepool_parser.py
and other code has no unused code, and that the code is written efficientlyExample scripts:
Tests:
Cleanup:
Plots (low priority):
In models, metrics etc:
After feedback on the figures, add the updated versions.
when I run calculate_metrics on the config 1 LSTM models, I get a shape error (Input 0 of layer "model" is incompatible with the layer: expected shape=(None, 24, 27), found shape=(None, 12, 1)).
Add a nightscout parser so that we can check predictions up against loop in real time.
Refactoring:
cli
in helpers, and add methods like "getModule" for models etc. to reduce cli.pyAdd real-time predictions (after config, so you dont need to refactor):
Update CLI:
Documentation:
Finish:
As discussed, create the data directory as needed in the directory where the cli is being installed/used
Finish current script:
Create a script that:
Before merge:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.