Skip to content

skymagi-d/causal-coefficient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soil Temperature Causal Analysis

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.

Overview

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.

Features

  • 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

Requirements

  • Python 3.x
  • TensorFlow (v1.x compatibility mode)
  • NumPy
  • Pandas

Project Structure

├── data/
│   └── soiltemperature/
│       └── agric2A_72.csv
├── ltc_model.py
├── soiltemperature.py
└── run.bat

Installation

  1. Clone the repository:
git clone https://github.com/skymagi-d/causal-coefficient.git
cd causal-coefficient
  1. Install required Python packages:
pip install tensorflow numpy pandas

Usage

Run the model using the following command:

python soiltemperature.py --model ltc --size 32 --epochs 200 --log 1

Command Line Arguments

  • --model: Model type (default: "ltc")
  • --size: Model size (default: 32)
  • --epochs: Number of training epochs (default: 200)
  • --log: Log period for output (default: 1)

Model Details

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

Output

The model generates causal relationship analysis results in:

results/soiltemperature/Cause-effect relationships - agric2A_72.csv

Model checkpoints are saved in:

tf_sessions/soiltemperature/

License

MIT License

Contributors

  • skymagi-d

References

  • LTC (Liquid Time-Constant) Neural Networks
  • Pearson Correlation Coefficient for Causal Analysis

About

Soil Temperature Causal Analysis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published