Skip to main content

No project description provided

Project description

🌿 PRIMA: A tool for Palaeoclimatic Reconstruction through Interactive Modelling & Analysis

PRIAM is an interactive tool for proxy-based climate reconstruction and analysis. It allows users to import palaeoecological proxy data—such as fossil pollen, sediments, or other biological indicators—and apply multiple statistical and machine learning methods to reconstruct past climate conditions. The app provides instant model training, validation, and visualization, offering insights into model performance, feature importance, and uncertainty. Users can explore reconstructed climate variables through dynamic plots, comparative analyses, and summary statistics, making it a comprehensive platform for both research and teaching in palaeoclimatology.

This project implements multiple methods for quantitative palaeoclimate reconstruction from fossil pollen data, including:

  • Modern Analogue Technique (MAT)
  • Boosted Regression Trees (BRT)
  • Weighted Averaging Partial Least Squares (WA-PLS)
  • Random Forest (RF)

It also provides a web-based interface using Streamlit.

📦 Installation

1. Clone this repository

git clone https://github.com/yourusername/PyLae.git
cd pollen-recon

2. Create and activate a conda environment

conda env create -f environment.yml
conda activate pylaeo

⚙️ Command-Line Usage

The main pipeline is in main.py. It trains models on training climate + pollen data and predicts for fossil pollen samples.

Example

python main.py \
  --train_climate ./data/train/AMPD_cl_worldclim2.csv \
  --train_pollen ./data/train/AMPD_po.csv \
  --test_pollen ./data/test/scrubbed_SAR.csv \
  --model RF \
  --target TANN \
  --output_csv ./out/predictions.csv

Arguments:

  • --train_climate: CSV with climate variables (targets).
  • --train_pollen: CSV with modern pollen counts.
  • --test_pollen: CSV with fossil pollen data.
  • --model: Model choice (MAT, BRT, WA-PLS, RF).
  • --target: Target variable to reconstruct (e.g., TANN).
  • --output_csv: Where to save predictions.

📊 Visualization

Once predictions are saved, you can plot them with:

python visuals/plot.py \
  --predictions_csv ./out/predictions.csv \
  --output_file ./out/predictions.png \
  --title "Reconstructed TANN"

🌐 Streamlit Web App

For an interactive interface:

streamlit run app.py

This will launch a web UI at http://localhost:8501.

Features:

  • Upload training and fossil pollen CSVs.
  • Choose model + target variable.
  • Run predictions interactively.
  • View results as a table and time-series plot.
  • Download predictions as CSV.

📂 Project Structure

├── app.py                # Streamlit web app
├── main.py               # CLI pipeline
├── models/               # Model classes (MAT, BRT, WA-PLS, RF)
├── utils/dataloader.py   # Data loading + preprocessing
├── visuals/plot.py       # Visualization script
├── data/                 # Example datasets
├── out/                  # Output predictions + plots
├── requirements.txt      # Dependencies
└── README.md             # This file

🧑‍💻 Development Notes

  • Datasets are aligned automatically (non-overlapping taxa filled with zeros).
  • Predictions are saved with column name Predicted_<target>.
  • Tested on Linux (Python 3.10).

👩‍🔬 Authors

Dael Sassoon — Palaeoecologist and Marie Curie Research Fellow (GEO3BCN-CSIC, Barcelona). Specialising in tropical palaeoecology and quantitative reconstruction of past climates. Developer of PRIAM, integrating palaeoecological data with statistical and machine learning models for climate reconstruction.

Jordan Sassoon — Computer Scientist. Focused on applied AI, data systems, and scientific visualization. Lead developer of the PRIAM interface, integrating backend modelling pipelines with an interactive analytical framework.

🧠 Citation

If you use PRIAM in your research, please cite as:

Sassoon, D., & Sassoon, J. (2025). PRIAM: A tool for Palaeoclimatic Reconstruction through Interactive Analysis & Modelling. GitHub repository: https://github.com/jordisassoon/PRIAM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

primacore-0.1.7.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

primacore-0.1.7-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file primacore-0.1.7.tar.gz.

File metadata

  • Download URL: primacore-0.1.7.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for primacore-0.1.7.tar.gz
Algorithm Hash digest
SHA256 d7879ea61d05b822e2a301d5b50b9acdc8f5e02e6b415d14bb293cbad27c21db
MD5 f4379f3e4e7c30af8c1c2e8a1b1cd926
BLAKE2b-256 22e57104cc18cc30044cd28df087ee99ec62254bad8aa97f4ae80b4f6e5d33a3

See more details on using hashes here.

File details

Details for the file primacore-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: primacore-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for primacore-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cefeafc84eec29e61eeaf9cbcd3a103fabd89f3b5965e4025beca16000a8f2c7
MD5 b404e1acc7ff6ce7afb09ed13dec4cdb
BLAKE2b-256 90b3d938c1e918a79b17c07245bb730b9bfac6927617265cb28a3b7667217973

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page