Workshop SPARE_SCORES Model Training & Testing
This project involves training and testing a SPARE_SCORES model using the SPARE framework. The provided CLI tool allows users to easily train a model on a given dataset and test it on another dataset.
Table of Contents
Installation
-
Clone the repository:
git clone https://github.com/yourusername/iSTAGING_Workshop.git cd iSTAGING_Workshop
-
Create a virtual environment:
conda create -n workshop python=3.8 conda activate workshop
-
Install the dependencies:
pip install numpy pandas scikit-learn spare-scores
Usage
The CLI tool supports both training and testing modes. It can be invoked as follows:
-
Training:
python iSTAGING_Workshop/cli.py --action train --input path/to/train_data.csv --output path/to/save_model.pkl.gz
-
Testing:
python iSTAGING_Workshop/cli.py --action test --input path/to/test_data.csv --model path/to/saved_model.pkl.gz --output path/to/save_results.csv
CLI arguments
Required CLI arguments
-a, --action: The action to be performed, either train or test.-i, --input: The dataset to be used for training/testing, provided as a CSV file.
Optional Arguments
-m, --model, --model_file: The model file to be used for testing. Required for testing.-o, --output: The filename for the model to be saved (if training) or the test results to be saved (if testing).-h, --help: Show the help message and exit.-V, --version: Display the version of the package.
Examples
-
Training a Model
To train a model with the provided training dataset:
python cli.py --action train --input data/train_data.csv --output my_model.pkl.gz
-
Testing a Model
To test the provided model:
python cli.py --action test --input test_data.csv --model model/test.pkl.gz --output predictions.csv
Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes. Check out the CONTRIBUTING.md for more info! Also check out the Code of Conduct of the project.
License
This project is licensed under the CBICA License - see the LICENSE file for details.
References
-
SPARE-AD
Davatzikos, C., Xu, F., An, Y., Fan, Y. & Resnick, S. M. Longitudinal progression of Alzheimer's-like patterns of atrophy in normal older adults: the SPARE-AD index. Brain 132, 2026-2035, doi:10.1093/brain/awp091 (2009).
@article{davatzikos2009sparead, title={Longitudinal progression of Alzheimer's-like patterns of atrophy in normal older adults: the SPARE-AD index}, author={Davatzikos, Christos and Xu, Feng and An, Yaakov and Fan, Yong and Resnick, Susan M}, journal={Brain}, volume={132}, pages={2026--2035}, year={2009}, publisher={Oxford University Press}, doi={10.1093/brain/awp091} }
-
SPARE-BA
Habes, M. et al. Advanced brain aging: relationship with epidemiologic and genetic risk factors, and overlap with Alzheimer disease atrophy patterns. Transl Psychiatry 6, e775, doi:10.1038/tp.2016.39 (2016).
@article{habes2016spareba, title={Advanced brain aging: relationship with epidemiologic and genetic risk factors, and overlap with Alzheimer disease atrophy patterns}, author={Habes, Mollie and others}, journal={Translational Psychiatry}, volume={6}, pages={e775}, year={2016}, publisher={Nature Publishing Group}, doi={10.1038/tp.2016.39} }
-
diSPARE-AD
Hwang, G. et al. Disentangling Alzheimer's disease neurodegeneration from typical brain ageing using machine learning. Brain Commun 4, fcac117, doi:10.1093/braincomms/fcac117 (2022).
@article{hwang2022disparead, title={Disentangling Alzheimer's disease neurodegeneration from typical brain ageing using machine learning}, author={Hwang, Gabriel and others}, journal={Brain Communications}, volume={4}, pages={fcac117}, year={2022}, publisher={Oxford University Press}, doi={10.1093/braincomms/fcac117} }
Disclaimer
- The software has been designed for research purposes only and has neither been reviewed nor approved for clinical use by the Food and Drug Administration (FDA) or by any other federal/state agency.
Contact
For more information and support, please contact aidinisg@pennmedicine.upenn.edu.
Metadata
Release files for iSTAGING-Workshop 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| istaging_workshop-0.1.1.tar.gz | 817.5 kB | Without provenance | Details for istaging_workshop-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iSTAGING_Workshop-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for iSTAGING_Workshop-0.1.1-py3-none-any.whl |
Total release size: 823.8 kB
Release files / istaging_workshop-0.1.1.tar.gz
| Download URL | istaging_workshop-0.1.1.tar.gz |
|---|---|
| Size | 817.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fed996edf16e01ac0e455637daf8d4f7a91b8d0576eca8979e638bd5ef190518
|
|
BLAKE2b-256 checksum How to use checksums |
d398fd36176c19fd11b7e5eed7f1c770efbae55da9ab54483248ab15a1fcd52b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.19
|
Release files / iSTAGING_Workshop-0.1.1-py3-none-any.whl
| Download URL | iSTAGING_Workshop-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e26c1d9d73412c495e15360a69e44488ab5695be8b95f283da49678044532662
|
|
BLAKE2b-256 checksum How to use checksums |
158ffc59c71b96ae3edf97f8a23523ab555165ec76ffbb2937f99a2adf9492d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.19
|
Security for iSTAGING-Workshop 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.