A Streamlit web application for getting predictions from IBM watsonx transplant allocation models.
- 📁 CSV file upload for batch predictions
- 🔐 Flexible authentication (Bearer Token or API Key)
- 📊 Interactive data visualization
- 📥 Downloadable results with predictions
- ⚡ Real-time prediction processing
- Python 3.8+
- IBM Cloud account with watsonx access
- Deployed watsonx model endpoint
- Clone this repository:
git clone https://github.com/yourusername/transplant-model-predictions.git
cd transplant-model-predictions- Install required packages:
pip install -r requirements.txt- Run the Streamlit app:
streamlit run transplant_model_app.py-
Configure your settings in the sidebar:
- Enter your watsonx endpoint URL
- Choose authentication method (Bearer Token or API Key)
- Enter your credentials
-
Upload your CSV file containing the data for predictions
-
Click "Get Predictions" to run the model
-
Download the results with predictions included
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-tokensIf 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
Your input CSV should contain columns that match your watsonx model's expected features. Missing values will be automatically replaced with 0.
The application will add prediction columns to your original data:
prediction: The model's predicted class/valueprobability: Confidence score (if available from the model)
- Never commit API keys or tokens to version control
- Tokens expire after approximately 20 minutes
- All credentials are entered at runtime and not stored
See requirements.txt for all dependencies.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
- Built with Streamlit
- Powered by IBM watsonx
For issues or questions, please open an issue in the GitHub repository.