Skip to main content

A lightweight package for strength of the relationship between two variables analysis.

Project description

Relazioni

Relazioni is a lightweight package for strength of the relationship between variables analysis.

Documentation: https://chicodelarosa.com/relazioni
Source code: https://github.com/chicodelarosa/relazioni
Bug reports: https://github.com/chicodelarosa/relazioni/issues

It provides easy to use functions for measuring the relationship between variables of the following natures:

Two Continuous

A variable that can reasonably take on any value within a range. Examples of continuous variables include height, weight, exam scores, income, salary, etc.

Two Categorical

A variable that is a category without a natural order. Examples of categorical variables are eye color, city of residence, type of dog, etc.

At least One Ordinal

A variable with categories that have an inherent order. For instance, education level (GDE/Bachelors/Masters/PhD), income level (if grouped into high/medium/low) etc.

One Binary and One Continuous

A variable that is a category with only two possible values. Examples of binary variables include gender (male/female) or any True/False or Yes/No variable.

Relazioni currently supports 8 different association functions for investigating the relationship between variables in the following cases:

  1. Two Continuous and Covariates
    • Partial Correlation (R)
  2. Two Continuous and No Covariates
    • Pearson Correlation
  3. Two Categorical and Two Values per Variable
    • Phi Coefficient
  4. Two Categorical and More than Two Values per Variable
    • Cramer’s V
    • Theil's U
  5. At Least One Ordinal
    • Kendall’s Tau
    • Spearman’s Rho
  6. One Continuous and One Binary
    • Point-biserial Correlation

Requirements

scipy
numpy
pandas
scikit-learn

Installation

Installing via pypi

pip install relazioni

Installing via pip

pip install .

Installing via setup.py

python setup.py install

Installing via Git

python -m pip install git+https://github.com/chicodelarosa/relazioni.git

Example

import numpy as np
from relazioni import associations

v1, v2 = np.array([1, 1, 2]), np.array([1, 1, 2])

matth_corr = associations.matthews_corr(v1, v2)
print(matth_corr) # 1.0

v1, v2 = np.array([1, 1, 2]), np.array([2, 1, 2])

matth_corr = associations.matthews_corr(v1, v2)
print(matth_corr) # 0.5

Call for Contributions

The relazioni package welcomes your expertise and enthusiasm!

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

relazioni-0.0.2.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file relazioni-0.0.2.tar.gz.

File metadata

  • Download URL: relazioni-0.0.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

File hashes

Hashes for relazioni-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b97b218c9c35244331492ff3a5a62f3368ed6b28c22054241807d6868259cd52
MD5 b11803d51e509f4b848a126bbf94a0cb
BLAKE2b-256 6e1f58072f5f9eb73d29ec0be2769e097ce38db64017d117b0f7ea65e9af2129

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