Spaces:
Build error
Build error
File size: 2,088 Bytes
f338f91 6091825 f338f91 6091825 f338f91 6091825 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
---
title: Soil Resistivity Prediction
emoji: 🚗
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: "1.29.0"
app_file: app.py
pinned: false
---
# Soil Resistivity Prediction Tool
This application predicts soil resistivity based on various soil properties using a deep learning model with a transformer-based architecture.
## Features
- Interactive web interface for inputting soil properties
- Real-time prediction of soil resistivity
- SHAP-based explanation of feature importance
- Visualization of prediction results
## Installation
1. Make sure you have Python 3.8+ installed
2. Install the required packages:
```bash
pip install -r requirements.txt
```
## Usage
1. Run the Streamlit application:
```bash
streamlit run app.py
```
2. Open your web browser and navigate to the URL shown in the terminal (typically http://localhost:8501)
3. Enter the soil properties in the input fields
4. Click the "Predict Resistivity" button to get a prediction
5. View the prediction result and feature importance explanation
## Files
- `app.py`: The main Streamlit application
- `data.xlsx`: Sample data used for scaling and background for SHAP explanations
- `best_val_r2_model.pth`: The trained PyTorch model
- `scaler_X.pkl`: Scaler for input features
- `scaler_y.pkl`: Scaler for target variable
- `feature_names.json`: Names of the input features
- `temp/`: Directory for temporary files (created automatically)
## Model Architecture
The model uses a transformer-based architecture with:
- Feature embeddings for each input feature
- Multi-head self-attention mechanisms
- Both feature-wise and sample-wise attention
- Residual connections and layer normalization
## Troubleshooting
If you encounter any issues:
1. Make sure all required files are in the same directory
2. Check that all dependencies are installed correctly
3. Ensure you have sufficient permissions to create the temp directory
4. If you see warnings about feature names, these can be safely ignored
## License
This project is licensed under the MIT License - see the LICENSE file for details. |