Resistivity / README.md
Sompote's picture
Upload 6 files
778f96f verified
---
title: Soil Resistivity Prediction
emoji: πŸš—
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: "1.29.0"
app_file: app.py
pinned: false
---
# Resistivity Prediction App
This is a Streamlit web application for predicting resistivity based on input features. The app uses a trained deep learning model with attention mechanism and provides SHAP value explanations for predictions.
## Setup Instructions
1. Create a virtual environment (recommended):
```bash
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
```
2. Install required packages:
```bash
pip install -r requirements.txt
```
3. Place the following files in the same directory:
- `model.pth` (trained model file)
- `data.xlsx` (dataset file with features and target)
## Running the App
To run the app, use the following command:
```bash
streamlit run app.py
```
The app will be available at http://localhost:8501 by default.
## Usage
1. Enter values for each feature using the input fields
2. Click the "Predict" button
3. View the prediction result and SHAP value explanation
## Files Description
- `app.py`: Main Streamlit application file
- `predict.py`: Contains model architecture and prediction functions
- `requirements.txt`: List of required Python packages
- `model.pth`: Trained model weights (not included, must be added)
- `data.xlsx`: Dataset file (not included, must be added)
## Model Architecture
The model uses a TabularTransformer architecture with:
- Feature embedding layer
- Multi-head attention mechanism
- Fully connected layers for prediction
## Requirements
- Python 3.8+
- Required packages listed in requirements.txt