Skip to main content

Classifier two-sample tests and noninferiority tests.

Project description

samesame

Python uv Ruff License: LGPLv3 arXiv

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 on and on.

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 documentation and examples.

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.0.tar.gz (16.3 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.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for samesame-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f71814fd03fe94ef09c0e3a5eb2cd38da65703b324dda8f9b20dc74f92e8e05
MD5 00d81c90308ddfe5a6dd74c8fd060c56
BLAKE2b-256 6fd7aa72860f8907f6b86543d3e48e08a8eb24e268e57fb040cb6194996992a5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for samesame-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0d4032fd35a7fbebe4e8636dd5ace11d06a545505791fcd36dd5b7231cd7f8b
MD5 ce1f010d4fe8af3d9e9333f679048dd4
BLAKE2b-256 3ac70175cce3698eeeca969f6c7dcea0dbb23b9477c7733ca52c8156d337bac9

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