resample

Randomization-based inference in Python

https://github.com/scikit-hep/resample

Science Score: 64.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 8 committers (12.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.0%) to scientific vocabulary

Keywords

bootstrap bootstrap-samples confidence-intervals jackknife jackknife-resampling permutation-test python resample

Keywords from Contributors

closember exoplanet

Scientific Fields

Mathematics Computer Science - 84% confidence
Last synced: 4 months ago · JSON representation ·

Repository

Randomization-based inference in Python

Basic Info
  • Host: GitHub
  • Owner: scikit-hep
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1.49 MB
Statistics
  • Stars: 82
  • Watchers: 3
  • Forks: 13
  • Open Issues: 4
  • Releases: 20
Topics
bootstrap bootstrap-samples confidence-intervals jackknife jackknife-resampling permutation-test python resample
Created over 7 years ago · Last pushed 4 months ago
Metadata Files
Readme License Citation

README.rst

.. |resample| image:: doc/_static/logo.svg
   :alt: resample
   :target: http://resample.readthedocs.io

|resample|
==========

.. image:: https://img.shields.io/pypi/v/resample.svg
   :target: https://pypi.org/project/resample
.. image:: https://img.shields.io/conda/vn/conda-forge/resample.svg
   :target: https://github.com/conda-forge/resample-feedstock
.. image:: https://github.com/resample-project/resample/actions/workflows/test.yml/badge.svg
   :target: https://github.com/resample-project/resample/actions/workflows/tests.yml
.. image:: https://coveralls.io/repos/github/resample-project/resample/badge.svg
   :target: https://coveralls.io/github/resample-project/resample
.. image:: https://readthedocs.org/projects/resample/badge/?version=stable
   :target: https://resample.readthedocs.io/en/stable
.. image:: https://img.shields.io/pypi/l/resample
   :target: https://pypi.org/project/resample
.. image:: https://zenodo.org/badge/145776396.svg
   :target: https://zenodo.org/badge/latestdoi/145776396

`Link to full documentation`_

.. _Link to full documentation: http://resample.readthedocs.io

.. skip-marker-do-not-remove

Resampling-based inference in Python based on data resampling and permutation.

This package was created by Daniel Saxton and is now maintained by Hans Dembinski.

Features
--------

- Bootstrap resampling: ordinary or balanced with optional stratification
- Extended bootstrap resampling: also varies sample size
- Parametric resampling: Gaussian, Poisson, gamma, etc.)
- Jackknife estimates of bias and variance of any estimator
- Compute bootstrap confidence intervals (percentile or BCa) for any estimator
- Permutation-based variants of traditional statistical tests (**USP test of independence** and others)
- Tools for working with empirical distributions (CDF, quantile, etc.)
- Depends only on `numpy`_ and `scipy`_

Example
-------

We bootstrap the uncertainty of the arithmetic mean, an estimator for the expectation. In this case, we know the formula to compute this uncertainty and can compare it to the bootstrap result. More complex examples can be found `in the documentation `_.

.. code-block:: python

      from resample.bootstrap import variance
      import numpy as np

      # data
      d = [1, 2, 6, 3, 5]

      # this call is all you need
      stdev_of_mean = variance(np.mean, d) ** 0.5
      
      print(f"bootstrap {stdev_of_mean:.2f}")
      print(f"exact {np.std(d) / len(d) ** 0.5:.2f}")
      # bootstrap 0.82
      # exact 0.83

The amazing thing is that the bootstrap works as well for arbitrarily complex estimators.
The bootstrap often provides good results even when the sample size is small.

.. _numpy: http://www.numpy.org
.. _scipy: https://www.scipy.org

Installation
------------
You can install with pip.

.. code-block:: shell

      pip install resample

Owner

  • Name: Scikit-HEP Project
  • Login: scikit-hep
  • Kind: organization
  • Email: scikit-hep-forum@googlegroups.com

A community project for High Energy Physics data analysis in Python

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: scikit-hep/resample
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Hans
    family-names: Dembinski
    email: hans.dembinski@gmail.com
    affiliation: TU Dortmund
    orcid: 'https://orcid.org/0000-0003-3337-3850'
  - given-names: Daniel
    family-names: Saxton
  - given-names: Henry
    family-names: Schreiner
  - given-names: Joshua
    family-names: Adelman
  - given-names: Eduardo
    family-names: Rodrigues
identifiers:
  - type: doi
    value: 10.5281/zenodo.7750255
repository-code: 'https://github.com/scikit-hep/resample'
url: 'https://resample.readthedocs.io/en/stable/'
abstract: 'Randomization-based inference in Python '
keywords:
  - Python
  - statistics
  - data analysis
  - Scikit-HEP
license: BSD-3-Clause

GitHub Events

Total
  • Watch event: 6
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 34
  • Pull request event: 6
  • Create event: 1
Last Year
  • Watch event: 6
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 34
  • Pull request event: 6
  • Create event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 312
  • Total Committers: 8
  • Avg Commits per committer: 39.0
  • Development Distribution Score (DDS): 0.641
Past Year
  • Commits: 6
  • Committers: 3
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Hans Dembinski H****i 112
Daniel Saxton 2****n 63
Daniel Saxton d****n@g****m 60
pre-commit-ci[bot] 6****] 40
daniel saxton d****n@B****l 26
Henry Schreiner H****I@g****m 9
Joshua Adelman s****s 1
Eduardo Rodrigues e****s@c****h 1
Committer Domains (Top 20 + Academic)
cern.ch: 1

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 23
  • Total pull requests: 109
  • Average time to close issues: 4 months
  • Average time to close pull requests: 15 days
  • Total issue authors: 7
  • Total pull request authors: 6
  • Average comments per issue: 3.3
  • Average comments per pull request: 0.61
  • Merged pull requests: 98
  • Bot issues: 0
  • Bot pull requests: 44
Past Year
  • Issues: 0
  • Pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: 22 days
  • Issue authors: 0
  • Pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.86
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
  • HDembinski (16)
  • eduardo-rodrigues (2)
  • JohannesWiesner (2)
  • guhan-lily (1)
  • asalcedo29 (1)
  • dsaxton (1)
  • DonataOsthues (1)
Pull Request Authors
  • HDembinski (54)
  • pre-commit-ci[bot] (50)
  • henryiii (16)
  • dsaxton (5)
  • jpwgnr (1)
  • ritikbhatia (1)
  • eduardo-rodrigues (1)
Top Labels
Issue Labels
docs (2) bug (2)
Pull Request Labels
documentation (1)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 3
conda-forge.org: resample
  • Versions: 3
  • Dependent Packages: 1
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.4%
Dependent packages count: 29.0%
Average: 33.6%
Stargazers count: 37.1%
Forks count: 43.8%
Last synced: 4 months ago

Dependencies

.github/workflows/coverage.yml actions
  • AndreMiras/coveralls-python-action develop composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • numpy >= 1.21
  • scipy >= 1.10