Code Monkey home page Code Monkey logo

gai_paper's Introduction

GAI Calculator

This is a Python script for calculating Gut Aging Index (GAI) based on OTU (Operational Taxonomic Units) data.

The datasets used in paper can be downloaded with download_data.sh BASH script.

Prerequisites

  • Python 3.x
  • pandas
  • pycaret 2.3.5

Installation

  1. Clone the repository:
git clone https://github.com/zwbao/GAI_paper.git
  1. Install the required Python packages:
pip install pandas
pip install pycaret==2.3.5

Usage

  1. Prepare the input files:

    • meta.tsv: The metadata file containing demographic information, with a column named 'id' as the index column.
    • otu.tsv: The OTU file containing operational taxonomic unit data, with a column named 'id' as the index column.
  2. Run the script:

python gai_cal.py meta.tsv otu.tsv
  1. Output files:
    • compare_models.tsv: A file containing the results of comparing different regression models.
    • tuned_best_model.tsv: A file containing the results of tuning the best model.
    • final_best_model_<date>.pkl: A file containing the finalized best model, where <date> represents the current date in the format YYYYMMDD.
    • adjust_values.tsv: A file containing average raw GAI values for different age ranges.
    • result.tsv: A file containing the final results, including age, raw GAI, adjusted value, and corrected GAI.

Using Pre-trained Models

To use the pre-trained models from the 'models' folder, follow these steps:

  1. Load a model using PyCaret:

    from pycaret.classification import load_model
    model = load_model('path/to/model')
  2. Prepare your data as specified in the meta.tsv and otu.tsv files, ensuring it matches the format the model expects.

  3. Predict GAI using the loaded model:

    predictions = predict_model(model, data=unseen_data)

This allows for quick application of our research findings and replication of results using established models.

Contact

If you have any questions or issues, please feel free to contact me at [email protected].

gai_paper's People

Contributors

zwbao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.