Skip to content

lamar09/TDS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🫀 Transplant Model Predictions

A Streamlit web application for getting predictions from IBM watsonx transplant allocation models.

Features

  • 📁 CSV file upload for batch predictions
  • 🔐 Flexible authentication (Bearer Token or API Key)
  • 📊 Interactive data visualization
  • 📥 Downloadable results with predictions
  • ⚡ Real-time prediction processing

Prerequisites

  • Python 3.8+
  • IBM Cloud account with watsonx access
  • Deployed watsonx model endpoint

Installation

  1. Clone this repository:
git clone https://github.com/yourusername/transplant-model-predictions.git
cd transplant-model-predictions
  1. Install required packages:
pip install -r requirements.txt

Usage

  1. Run the Streamlit app:
streamlit run transplant_model_app.py
  1. Configure your settings in the sidebar:

    • Enter your watsonx endpoint URL
    • Choose authentication method (Bearer Token or API Key)
    • Enter your credentials
  2. Upload your CSV file containing the data for predictions

  3. Click "Get Predictions" to run the model

  4. Download the results with predictions included

Authentication

Option 1: Bearer Token

If you already have a valid bearer token:

  • Select "Bearer Token" in the sidebar
  • Paste your token

To generate a token via CLI:

ibmcloud login --sso
ibmcloud iam oauth-tokens

Option 2: API Key

If you have an IBM Cloud API Key:

  • Select "API Key (auto-generate token)" in the sidebar
  • Paste your API key
  • The app will automatically generate a fresh token

CSV Format

Your input CSV should contain columns that match your watsonx model's expected features. Missing values will be automatically replaced with 0.

Output

The application will add prediction columns to your original data:

  • prediction: The model's predicted class/value
  • probability: Confidence score (if available from the model)

Security Notes

  • Never commit API keys or tokens to version control
  • Tokens expire after approximately 20 minutes
  • All credentials are entered at runtime and not stored

Requirements

See requirements.txt for all dependencies.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Acknowledgments

Support

For issues or questions, please open an issue in the GitHub repository.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages