Skip to main content

Classifier two-sample tests and noninferiority tests.

Project description

samesame

Python PyPI - Downloads Static Badge License: LGPLv3 UAI 2022 uv Ruff

Same, same but different ...

samesame implements classifier two-sample tests (CTSTs) and as a bonus extension, a noninferiority test (NIT).

These were either missing or implemented with some tradeoffs (looking at you, sample-splitting) in existing libraries. And so, samesame fills in the gaps :)

Motivation

What is samesame good for? It is for data (model) validation, performance monitoring, drift detection (dataset shift), statistical process control, and so on and so forth.

Want more? Here you go. This motivating example comes from the related R package dsos.

Installation

To install, run the following command:

python -m pip install samesame

Usage

Functionality

Below, you will find an overview of common modules in samesame.

Function Module
Bayesian inference samesame.bayes
Classifier two-sample tests (CTSTs) samesame.ctst
Noninferiority tests (NITs) samesame.nit

Attributes

When the method is a statistical test, samesame saves (stores) the results of some potentially computationally intensive results in attributes. These attributes, when available, can be accessed as follows.

Attribute Description
.statistic The test statistic for the hypothesis.
.null The null distribution for the hypothesis.
.pvalue The p-value for the hypothesis.
.posterior The posterior distribution for the hypothesis.
.bayes_factor The bayes factor for the hypothesis.

Examples

To get started, please see the examples in the docs.

Dependencies

samesame has few dependencies beyond the standard library. It will probably work with some older Python versions. It is, in short, a lightweight dependency for most machine learning projects.samesame is built on top of, and is compatible with, scikit-learn and numpy.

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

samesame-0.1.2.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

samesame-0.1.2-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file samesame-0.1.2.tar.gz.

File metadata

  • Download URL: samesame-0.1.2.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for samesame-0.1.2.tar.gz
Algorithm Hash digest
SHA256 47446caf0655f15a10d67b938c16c405b38611c712173b418d9dd9615064bac0
MD5 ed33544bc26479794f9df2e183ffab96
BLAKE2b-256 12c400c3f12cd14213088cf5ba662d9d09e03bcac39c80077007ecd20558fc96

See more details on using hashes here.

File details

Details for the file samesame-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: samesame-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for samesame-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 655b20a707cf0d66d9d98b4f659408361d5971c9324294cbcf5d6190c5acbdeb
MD5 71dd63d9c960e7c8f27a48f2112ce5f1
BLAKE2b-256 415307786a688806962a352a644e1ce44c565cfb249023ddb8b14131d4bb5a45

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