Skip to content

dylanprins/merqato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Merqato Price Forecasting

A time-series forecasting project designed to predict strawberry prices with a 2-week horizon using a simple Transformer model. The dataset includes weekly data between 2013 and 2023 with weather and pricing features.

πŸ“ Project Structure

β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ dataset.py         # PyTorch Dataset and DataLoader split logic
β”‚   └── preprocess.py      # Preprocessing, time-aware imputation logic
β”‚
β”œβ”€β”€ local_data/
β”‚   β”œβ”€β”€ models/            # Trained model weights (e.g. model.pt)
β”‚   β”œβ”€β”€ plots/             # Saved performance plots
β”‚   β”œβ”€β”€ processed/         # Preprocessed parquet files
β”‚   └── raw/               # Raw CSV data
β”‚
β”œβ”€β”€ model/
β”‚   β”œβ”€β”€ model.py           # Transformer model definition
β”‚   β”œβ”€β”€ simulate.py        # Evaluation script with metrics + matplotlib plots
β”‚   └── train.py           # Training loop with wandb integration

🧠 Core Functionality

1. Preprocessing

  • Safe handling of missing values
  • Weekly date reconstruction
  • Time-aware imputation of prices with Random Forest regressors if desired
python -m data.preprocess --data local_data/raw/senior_ds_test.csv --impute

2. Dataset

  • Custom PriceForecastDataset for rolling-window normalization
  • Splits data by year into train/val/test
  • Efficient DataLoader setup

3. Model

  • Minimal Transformer encoder
  • Sequence-to-one prediction
  • Continuous price output

4. Training

  • Logs to Weights & Biases (wandb)
  • Early saving of best model
python -m model.train --data local_data/processed/data_2013_2023.parquet

5. Evaluation

  • MAE, RMSE, MAPE, RΒ² metrics
  • Matplotlib plots for predictions vs actuals
python -m model.simulate --model_path local_data/models/original.pt

βš™οΈ Requirements

Install everything with:

conda env create -f environment.yml

Then install preferred PyTorch in that environment, e.g.:

conda activate dylan-merqato

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

πŸ“Œ Notes

  • All preprocessing is done without data leakage (only past data is used).
  • The model is very lightweight and intended as a prototype β€” you can easily extend it with more features, attention masks, or richer architectures.
  • Data is stored locally to prevent large files in version control.

πŸ‘‹ Author

Dylan Prins @ Neurality for Merqato Β· 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages