Spaces:
Sleeping
Sleeping
π HDD Solution Predictor - Deployment Package
Ready-to-deploy package for the HDD Solution Predictor application.
π¦ Package Contents
Application Files
app.py- Main Streamlit application (recommended)mobile_app.py- Mobile-optimized versionrequirements.txt- Python dependencies
Model Files
decision_tree_model.pkl- Trained Decision Tree model (100% accuracy)dt_soil_encoder.pkl- Soil type label encoderdt_water_encoder.pkl- Water table label encoderdt_solution_encoder.pkl- Solution label encoder
Assets
logo2.e8c5ff97.png- MEA (Metropolitan Electricity Authority) logoHDD_result.xlsx- Training dataset
Documentation
README.md- This deployment guide
π§ Quick Deployment
1. Install Dependencies
pip install -r requirements.txt
2. Run Application
# Main application (recommended)
streamlit run app.py
# Or mobile version
streamlit run mobile_app.py
3. Access Application
- Local:
http://localhost:8501 - Network: Will be shown in terminal
π Deployment Options
Option A: Local Development
git clone <repository>
cd deploy
pip install -r requirements.txt
streamlit run app.py
Option B: Streamlit Cloud
- Upload all files to GitHub repository
- Connect to Streamlit Cloud
- Deploy from
deploy/app.py
Option C: Docker Deployment
Create Dockerfile:
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
Option D: Heroku Deployment
Create Procfile:
web: streamlit run app.py --server.port=$PORT --server.address=0.0.0.0
π Application Features
Core Functionality
- Input Parameters: Pipe diameter, soil type, water table
- ML Prediction: Decision Tree with 100% training accuracy
- Solution Types: A, B, C, D, E (different protection levels)
Technical Specifications
- Framework: Streamlit
- ML Model: Scikit-learn Decision Tree
- Design: Canva-style responsive UI
- Branding: MEA institutional logo
Supported Solutions
- Solution A: Enhanced Protection (Sheetpile + Trench + Grouting)
- Solution B: Maximum Protection (+ Casing)
- Solution C: Moderate Protection (Sheetpile + Trench)
- Solution D: Basic Protection (Grouting Only)
- Solution E: Minimal Intervention (No Additional Measures)
π System Requirements
Python Version
- Python 3.8 or higher (recommended: 3.11)
Dependencies
- streamlit
- pandas
- numpy
- scikit-learn
- joblib
- plotly
- openpyxl
- Pillow
Resources
- RAM: Minimum 512MB, Recommended 1GB
- Storage: ~50MB for all files
- Network: Internet connection for initial setup
π§ Configuration
Environment Variables (Optional)
export STREAMLIT_SERVER_PORT=8501
export STREAMLIT_SERVER_ADDRESS=0.0.0.0
Streamlit Config (Create .streamlit/config.toml)
[server]
port = 8501
address = "0.0.0.0"
[theme]
primaryColor = "#6c5ce7"
backgroundColor = "#ffffff"
secondaryBackgroundColor = "#f0f2f6"
π¨ Troubleshooting
Model Loading Issues
- Ensure all
.pklfiles are in the same directory - Check Python/scikit-learn version compatibility
Logo Not Displaying
- Verify
logo2.e8c5ff97.pngexists in directory - App will show MEA text fallback if logo missing
Port Already in Use
streamlit run app.py --server.port=8502
Permission Issues
chmod +x app.py
pip install --user -r requirements.txt
π± Mobile Access
The application is fully responsive and works on:
- β Desktop browsers
- β Mobile phones
- β Tablets
- β Touch devices
π Security Notes
- Application runs locally by default
- No external API calls
- Model predictions processed locally
- Training data included for reference only
π Support
Common Issues
- Dependencies: Run
pip install -r requirements.txt - Port conflicts: Use different port with
--server.port=XXXX - File paths: Ensure all files are in same directory
Performance
- Model loading: ~1-2 seconds on first run
- Predictions: Instant (<100ms)
- UI rendering: <1 second
π― Ready to Deploy!
- Install requirements:
pip install -r requirements.txt - Run application:
streamlit run app.py - Open browser: Navigate to displayed URL
- Start predicting: Enter parameters and get solutions!
π’ Powered by MEA (Metropolitan Electricity Authority)