Skip to main content

Example package for the iSTAGING Workshop

Project description

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

  1. Clone the repository:

    git clone https://github.com/yourusername/iSTAGING_Workshop.git
    cd iSTAGING_Workshop
    
  2. Create a virtual environment:

    conda create -n workshop python=3.8
    conda activate workshop
    
  3. 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:

  1. Training:

    python iSTAGING_Workshop/cli.py --action train --input path/to/train_data.csv --output path/to/save_model.pkl.gz
    
  2. 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

  1. 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
    
  2. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

istaging_workshop-0.1.1.tar.gz (817.5 kB view hashes)

Uploaded Source

Built Distribution

iSTAGING_Workshop-0.1.1-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page