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 ammonia_predict_3 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 ammonia_predict/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.1.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.1-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nh3pred-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b0acfcca12ea1a10a2890085562a506eabeb8df55085861c515e4ae3f09a76ec
MD5 4ffb3105eefe4b634e716b20f0e916c7
BLAKE2b-256 028b22b883a0cc94b9bf08c1a04879fba03538b9698b7da93a5e64a91e8353f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nh3pred-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7da13b80cdcfc62bfeb7c6af29dda707376494d04f175669209d83c76827390a
MD5 717692bcb10c0ddf3098b2f2387d7a57
BLAKE2b-256 04955ec7758b57f83a8fc1c0ca469a73e2c624356f01fbf69b8710344cf7a986

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