--- id: phik version: "0.12.5" license: unclear license_treatment: permissive maintenance: aging --- # phik — Phi_K correlation analyzer library License: permissive · Maintenance: aging · Downloads: 1.2M/mo ## What it is and what it does Phi_K is a correlation coefficient designed to handle mixed data types—categorical, ordinal, and interval variables—in a single analysis. Unlike traditional correlation methods that require homogeneous data types, Phi_K applies a refinement of Pearson's hypothesis test of independence, interpreting the contingency test statistic as if from a rotated bivariate normal distribution. It captures non-linear relationships and reverts to standard Pearson correlation when the input is bivariate normal, making it useful for exploratory data analysis on heterogeneous datasets. The package integrates with pandas DataFrames through methods like `phik_matrix()`, `significance_matrix()`, and `global_phik()`, and includes utilities for generating correlation reports as PDFs. It depends on numpy, scipy, pandas, matplotlib, and joblib, and is available as pre-built wheels for Python 3.9–3.14 across macOS, Linux, and Windows. The methodology is grounded in a peer-reviewed publication and includes example notebooks for basic and advanced usage. Use it for: - Compute correlation matrices for datasets mixing categorical survey responses, ordinal ratings, and continuous measurements. - Detect non-linear dependencies between variables that Pearson correlation would miss. - Generate statistical significance tests for variable-pair dependencies in contingency tables. - Create correlation reports with visualizations for exploratory data analysis on mixed-type datasets. - Identify outliers and unusual patterns via normalized residuals of contingency tests. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Phi_K computes a correlation coefficient that works consistently across categorical, ordinal, and interval variables, capturing non-linear dependencies while reverting to Pearson correlation for bivariate normal data. Yes, if you work with mixed-type data and need a single correlation method that handles categorical, ordinal, and interval variables together. The permissive MIT license and broad Python version support make adoption low-risk. However, the aging maintenance status (no release in 393 days) suggests checking whether active development continues before relying on it for production systems. No known vulnerabilities. ## Install pip install phik uv add phik poetry add phik ## Installing phik Before you install: Medium install friction due to compiled wheels for multiple Python versions (3.10–3.14) and platforms, but pre-built binaries are available. Package is aging (393 days since last release in July 2025) with no recent maintenance signal. License in practice: MIT license (permissive) permits commercial and private use with minimal restrictions, making it suitable for most projects. Quickstart: pip install phik import pandas as pd import phik df = pd.read_csv('data.csv') phik_matrix = df.phik_matrix() significance = df.significance_matrix() Requires Python >= 3.9; depends on numpy, scipy, pandas, matplotlib, and joblib. Verify before relying: - Whether the package is actively maintained or if aging status indicates stalled development. - Performance characteristics when applied to large datasets or high-dimensional correlation matrices. - Specific use cases where Phi_K outperforms alternatives for mixed-type data beyond the published paper. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: aging - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags correlation coefficient mixed data types, categorical ordinal interval correlation, phi_k correlation analyzer, non-linear dependency detection, mixed variable correlation matrix, contingency table correlation, statistical correlation analysis, correlation-analysis, mixed-data-types, statistical-testing [View on SkillFed](https://skillfed.io/packages/phik) · [View on PyPI](https://pypi.org/project/phik/)