Skip to main content

Recursive Mode Detection for ordinal data

Project description

ReMoDe: a Python library for efficient mode detection in ordinal data distributions.

ReMoDe (Recursive Mode Detection) is a Python library designed for the robust detection of modes in ordinal data distributions. It uses statistical tests, including Fisher's exact test and binomial tests, to determine if a given maximum in a data distribution is a true local maximum.

Features

  • Mode Detection: Identifies all potential local maxima in the dataset.
  • Statistical Tests: Implements Fisher's exact test and binomial tests to validate modes.
  • Mode Statistics: Returns per-mode p-values and approximate Bayes factors.
  • Data Formatting: Converts raw data into histogram format for analysis.
  • Stability Analysis: Includes functionality to assess the stability of detected modes using jackknife resampling.
  • Visualization: Provides methods to plot the histogram of data along with identified modes.

Installation

pip install remode

Usage

Here is a simple example of how to use the ReMode library:

from remode import ReMoDe

# Sample data (histogram counts)
xt_count = [8, 20, 5, 2, 6, 2, 30]

# Create an instance of ReMoDe
detector = ReMoDe(alpha_correction="descriptive_peaks")  # default

# Fit model
results = detector.fit(xt_count)
# results contains:
# - nr_of_modes
# - modes
# - p_values
# - approx_bayes_factors

# Plot the results
detector.plot_maxima()

# Perform stability analysis
stability_info = detector.remode_stability(percentage_steps=50)

See also the tutorial here.

Citation

Please cite the following paper:

TBA

and the following software

Garcia-Bernardo, J., Hoffstadt, M., & van der Maas, H. L. J. (2025). ReMoDe: a Python library for efficient mode detection in ordinal data distributions. Zenodo. https://doi.org/10.5281/zenodo.15366121

Contributing

Contributions are what make the open source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Please refer to the CONTRIBUTING file for more information on issues and pull requests.

License

This project is licensed under the GNU GPLv3. This allows you to do almost anything they want with this project, except distributing closed source versions.

Contact

This project is a port of the R version of ReMoDe. It is maintained by the ODISSEI Social Data Science (SoDa) team.

SoDa logo

Do you have questions, suggestions, or remarks? File an issue in the issue tracker!

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

remode-0.2.0.tar.gz (122.6 kB view details)

Uploaded Source

Built Distribution

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

remode-0.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file remode-0.2.0.tar.gz.

File metadata

  • Download URL: remode-0.2.0.tar.gz
  • Upload date:
  • Size: 122.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for remode-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fc0ecb1ce3ed491eecd8334d6bfd7c34fc4f55404a9d5a950507c6be4e21a814
MD5 679c986275411f31876fdfec90ba7395
BLAKE2b-256 b1f779e28683842fd2f31015a42bade195740f6518cfab5e18631ddba092534f

See more details on using hashes here.

File details

Details for the file remode-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: remode-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for remode-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d881c8b0a89e023a2962f494a5db5fb5e0be901cf6f4104ed959f30eabbe751f
MD5 7e0f5dc96d92cca011930aded7c79a98
BLAKE2b-256 ad3d8cfa578f7b5f1cba1cd10aa10f5eab2737d5f71f5ef65b4acef4c3a33de2

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