This project implements a machine learning model to analyze causal relationships between various environmental factors and soil temperature measurements using a Liquid Time-Constant (LTC) neural network approach.
The project analyzes soil temperature data along with various environmental parameters to determine causal relationships between different measurements. It uses Pearson correlation coefficients to establish causal relationships and implements an LTC (Liquid Time-Constant) neural network for time-series analysis.
- Analysis of multiple environmental parameters including:
- Wind direction and speed
- Precipitation
- Air temperature
- Relative humidity
- Dew point
- Vapor pressure deficit (VPD)
- Soil moisture at different depths (10cm, 20cm, 30cm, 110cm, 120cm)
- Soil temperature at different depths (10cm, 20cm, 30cm)
- Implementation of LTC (Liquid Time-Constant) neural network
- Causal coefficient calculation using Pearson correlation
- Dataset splitting into training, validation, and test sets
- Model training with early stopping based on validation performance
- Python 3.x
- TensorFlow (v1.x compatibility mode)
- NumPy
- Pandas
├── data/
│ └── soiltemperature/
│ └── agric2A_72.csv
├── ltc_model.py
├── soiltemperature.py
└── run.bat
- Clone the repository:
git clone https://github.com/skymagi-d/causal-coefficient.git
cd causal-coefficient- Install required Python packages:
pip install tensorflow numpy pandasRun the model using the following command:
python soiltemperature.py --model ltc --size 32 --epochs 200 --log 1--model: Model type (default: "ltc")--size: Model size (default: 32)--epochs: Number of training epochs (default: 200)--log: Log period for output (default: 1)
The project implements three types of ODE solvers for the LTC model:
- Semi-Implicit (default)
- Explicit
- Runge-Kutta
The model architecture includes:
- Input layer with 16 features
- LTC layer with configurable size
- Dense output layer
The model generates causal relationship analysis results in:
results/soiltemperature/Cause-effect relationships - agric2A_72.csv
Model checkpoints are saved in:
tf_sessions/soiltemperature/
- skymagi-d
- LTC (Liquid Time-Constant) Neural Networks
- Pearson Correlation Coefficient for Causal Analysis