Machine learning pipeline for predicting the top temperature of a distillation column from weather-driven process data. The project combines historical weather loading, synthetic process-data generation, feature engineering with lag variables, and LightGBM regression.
- Weather loader for Moscow historical weather data from Visual Crossing.
- Synthetic process-data generator based on simplified heat-transfer and fouling models.
- LightGBM training pipeline for
T_top_Cprediction. - Correlation analysis and report figures.
- Pretrained LightGBM artifact and fitted scaler in
models/. - Aspen HYSYS simulation files in
simulations/.
.
├── data/ # local datasets; generated/downloaded CSV files are not required in git
├── models/ # trained model artifacts
├── reports/figures/ # process scheme and report images
├── simulations/ # Aspen HYSYS source files
├── src/
│ ├── analysis/ # exploratory analysis scripts
│ ├── data/ # data collection and synthetic-data generation
│ └── modeling/ # model training pipeline
├── .env.example
├── requirements.txt
└── README.md
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtTo download weather data, create .env or set the variable in your shell:
$env:VISUAL_CROSSING_API_KEY = "your_api_key"Download weather data:
python src/data/fetch_weather.py --start 2023-03-25 --end 2025-08-31 --out data/weather_summer_2025.csvGenerate synthetic process data:
python src/data/generate_synthetic_data.py --weather data/weather_summer_2025.csv --out data/synthetic_dataset.csvTrain the LightGBM model and save figures:
python src/modeling/train_lightgbm.py --input data/synthetic_dataset.csv --model-dir models --figures-dir reports/figuresBuild a correlation heatmap:
python src/analysis/correlation_heatmap.py --input data/synthetic_dataset.csv --out reports/figures/corr_heatmap.jpgThe model predicts T_top_C, the top temperature of the column. The training script uses:
- z-score filtering for numeric outliers;
- lag features over a 24-step window;
- chronological train/test split;
TimeSeriesSplitfor cross-validation;- grid search over LightGBM parameters;
- MAE, RMSE, and R2 as evaluation metrics.
The current trained artifacts are stored in:
models/best_lightgbm_model.pklmodels/scaler.pkl
Raw .docx drafts and generated training logs are intentionally excluded from the repository. API keys must be provided through environment variables, not committed to source control.
