Spaces:
Build error
Build error
A newer version of the Streamlit SDK is available:
1.52.2
metadata
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
- Make sure you have Python 3.8+ installed
- Install the required packages:
pip install -r requirements.txt
Usage
- Run the Streamlit application:
streamlit run app.py
- Open your web browser and navigate to the URL shown in the terminal (typically http://localhost:8501)
- Enter the soil properties in the input fields
- Click the "Predict Resistivity" button to get a prediction
- View the prediction result and feature importance explanation
Files
app.py: The main Streamlit applicationdata.xlsx: Sample data used for scaling and background for SHAP explanationsbest_val_r2_model.pth: The trained PyTorch modelscaler_X.pkl: Scaler for input featuresscaler_y.pkl: Scaler for target variablefeature_names.json: Names of the input featurestemp/: 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:
- Make sure all required files are in the same directory
- Check that all dependencies are installed correctly
- Ensure you have sufficient permissions to create the temp directory
- 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.