Skip to main content

Predict ammonia emissions with a recurrent neural network model

Project description

nh3pred

This package provides a single function, predict, which estimates ammonia emissions following field fertilization under given environmental conditions.
The underlying model is a recurrent neural network described in [ref] under the name "rnn 9 – data a.".
The predict function works similarly to the alfam2 function from the R package ALFAM2.

Install

pip install nh3pred 

Documentation

A complete documentation for the predict function is available here.

Usage

You can use the package in Python as follows:

import pandas as pd
from nh3pred import predict

df = pd.DataFrame ({
    "pmid": [1, 1, 1, 1, 1, 1],
    "ct": [3, 6, 10, 24, 48, 72],
    "tan_app": [42, 42, 42, 42, 42, 42],
    "air_temp": [18, 23, 24, 15, 21, 20],
    "wind_2m": [2, 2, 1, 1, 2, 2],
    "rain_rate": 0,
    "app_rate": [20, 20, 20, 20, 20, 20],
    "man_dm": [8.3, 8.3, 8.3, 8.3, 8.3, 8.3],
    "man_ph": [7.1, 7.1, 7.1, 7.1, 7.1, 7.1],
    "app_mthd": ["ts", "ts", "ts", "ts", "ts", "ts"],
    "man_source": ["cat", "cat", "cat", "cat", "cat", "cat"]
})

pred = predict(df)
print(pred)

Notes

  • The trained weights are included in the package under nh3pred/data/final_model.pth.
  • The package requires Python ≥3.12, PyTorch ≥2.5.0, and pandas ≥2.2.3.

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

nh3pred-0.1.3.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

nh3pred-0.1.3-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file nh3pred-0.1.3.tar.gz.

File metadata

  • Download URL: nh3pred-0.1.3.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nh3pred-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5d2ce4d739f165a6e88d20daa47d22aa3020d46398bad09a794321c441eb0935
MD5 0364975a0f468b5faad8675d52486385
BLAKE2b-256 bafa8d2026064ca0d09131d8dfd547c081b49b101d71e18088d5c376b6eafd9b

See more details on using hashes here.

File details

Details for the file nh3pred-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: nh3pred-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nh3pred-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9c2876aadeaadd7bc63e029fbe881cad08df71d61606eb1287508f95f203ee6a
MD5 f41c7557e551e2b06e2d9506699c03cb
BLAKE2b-256 ab190d6e5cd32d465ec0ac85925da999814f613b2911d9e2d6a6f6c410535bff

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