Skip to main content

Orakel: A small library of regression models of interest to the life sciences.

Project description

Orakel

Orakel is a small Python library of regression models based on NumPy and Scipy.

Purpose

The analysis and evaluation of experimental data are often influenced by artefacts or signal noise. Yet, the observed processes can often be described by mathematical models. Orakel provides implementations of various regression models that are suited for analysing enzyme kinetics and biological processes, such as bacterial growth.

Use

Orakel is intended to be used within a script or processing pipeline.

The following functions are implemented:

  • exponential_decay: exponential decay with optional non-zero asymptote (controlled by boolean flag non_zero_asymptote)
  • double_exponential_decay: double exponential decay with optional non-zero asymptote (controlled by boolean flag non_zero_asymptote)
  • gompertz: Gompertz' generalised logistic function
  • richards: Richards generalised logistic function
  • michaelis_menten: the Michaelis-Menten function
  • schnell_mendoza: explicit form of the Michaelis-Menten equation using Lambert's W function
  • power_function: the power function

For modelling and predictions based on these functions, all except the Schnell-Mendoza function can be used within the class NonlinearRegression. The Schnell-Mendoza function is not implemented as fitting-class, as its numerical complexity makes it particularly difficult to find suitable model parameters automatically without tight constraints.

After initialising the class (set non_zero_asymptote=True, to allow for exponential decays with non-zero asymptote), the model is fitted using fit(x, y). Predictions with the fitted model are made using predict(x_new). As an example, a model for exponential decay is fitted and used for predictions:

import numpy as np

from orakel.predict import exponential_decay, NonlinearRegression

x = np.linspace(0, 3)
y_true = exponential_decay(x, 1, 1.5)

rng = np.random.default_rng()
noise = rng.normal(0, .05, y_true.shape)
y_sample = y_true + noise

model = NonlinearRegression('exponential_decay')
model.fit(x, y_sample)
y_pred = model.predict(x)

While the array for the independent variable must be one-dimensional, the dependent variable can be of shape (n_samples, n_points). The array returned by predict is always of this shape.

Further information

Orakel is primarily the product of personal interest and an attempt to document findings. For this reason, it cannot be considered stable. However, if you find it helpful, you are welcome to use it.

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

orakel-1.0.0a1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

orakel-1.0.0a1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file orakel-1.0.0a1.tar.gz.

File metadata

  • Download URL: orakel-1.0.0a1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for orakel-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 a12bbb2b7144f1063db592b7882eaf3a87b58307e6614c03c7eb53099d25d24e
MD5 e66cf167b5bc9d496fcc6127e5f3968a
BLAKE2b-256 30780eae69f5d0005101373cccc56eff383f8aaaf6839c061ca5b6d61e0a4b52

See more details on using hashes here.

File details

Details for the file orakel-1.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: orakel-1.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for orakel-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 04bc2a2c06b23ef211f650b457ffe998c55a68c3292c2313782bcf45bfb6c668
MD5 6dc53ba29c41ccb107bcf3e8147b957c
BLAKE2b-256 9bde541641976180f161b31a9fe016aaf61df260174c563af2c5b9cb21b77dd2

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