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). The initial parameters and reasonable limits are estimated for each sample automatically. 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.0.tar.gz (9.0 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.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for orakel-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3fe11d272642f65a83ff0adb6f5b189990740c14857f93b532cc2f207f7a9d1a
MD5 60a69f21f9f6833b2433367ed3af1e49
BLAKE2b-256 024256a1b20e5039cfd3e48be905a22344a0c625fd28f6d30ec639946ce14554

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for orakel-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c51c053a608f082b03fb56ad12433c2c778eafe231825466fa93f25e8f61b5a
MD5 e2630e89b73f14408a9ac0e7116f7084
BLAKE2b-256 074294037e1c071e7b36b556d17a4d6958eda33e65cb77f6cccb55af65b17321

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