{"id":9822,"library":"hyppo","title":"Hyppo: Independence Testing","description":"Hyppo is a comprehensive independence testing package in Python, currently at version 0.5.2. It provides a wide array of statistical tests for evaluating independence, k-sample, and goodness-of-fit problems. The library has an active development cycle, with major releases bringing significant new features and bug fixes, typically every 12-16 months, complemented by more frequent patch releases.","status":"active","version":"0.5.2","language":"en","source_language":"en","source_url":"https://github.com/neurodata/hyppo","tags":["statistics","machine-learning","independence-testing","hypothesis-testing","nonparametric"],"install":[{"cmd":"pip install hyppo","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core numerical operations.","package":"numpy","optional":false},{"reason":"Core numerical operations.","package":"scipy","optional":false},{"reason":"Machine learning utilities and kernel functions.","package":"scikit-learn","optional":false},{"reason":"Required for automatic differentiation in some kernel computations.","package":"autograd","optional":false}],"imports":[{"symbol":"Hsic","correct":"from hyppo.independence import Hsic"},{"symbol":"Dcorr","correct":"from hyppo.independence import Dcorr"},{"symbol":"Energy","correct":"from hyppo.ksample import Energy"}],"quickstart":{"code":"import numpy as np\nfrom hyppo.independence import Hsic\n\n# Generate some data\nx = np.random.normal(0, 1, size=(100, 1))\ny = x + np.random.normal(0, 1, size=(100, 1))\n\n# Initialize and run the Hsic test\ntest = Hsic()\nstat, pvalue = test.test(x, y)\n\nprint(f\"Test Statistic: {stat:.4f}, P-value: {pvalue:.4f}\")","lang":"python","description":"This example demonstrates how to use the Hilbert-Schmidt Independence Criterion (HSIC) to test the independence between two sets of data, `x` and `y`."},"warnings":[{"fix":"Upgrade your Python environment to 3.8+ or pin `hyppo` to a version less than 0.5.0 (e.g., `pip install 'hyppo<0.5.0'`).","message":"Hyppo versions 0.5.0 and newer require Python 3.8 or higher. Users on older Python versions (3.6 or 3.7) will encounter errors if they upgrade past 0.4.x.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"For custom `DifferentiableKernel` subclasses, ensure you explicitly implement the `gradient` method with the desired differentiation logic. Do not rely on `autograd` to implicitly provide it.","message":"Starting from v0.5.2, the `DifferentiableKernel` class no longer provides an automatic `autograd` fallback for gradients. If you are implementing custom differentiable kernels, you must now manually define the `gradient` method.","severity":"breaking","affected_versions":">=0.5.2"},{"fix":"Manually install `autograd`: `pip install autograd`. Ensure your Python environment is clean or use a virtual environment.","message":"The `autograd` library is a core dependency for `hyppo`. While `pip install hyppo` typically handles this, if you encounter `ModuleNotFoundError` related to `autograd`, it might be missing or conflict with your environment.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Install `autograd` explicitly: `pip install autograd`.","cause":"The `autograd` library, a mandatory dependency for Hyppo, is not installed or not accessible in your Python environment.","error":"ModuleNotFoundError: No module named 'autograd'"},{"fix":"Upgrade your Python interpreter to version 3.8 or newer, or downgrade Hyppo to version 0.4.x or older: `pip install 'hyppo<0.5.0'`.","cause":"You are attempting to use Hyppo version 0.5.0 or newer with a Python version older than 3.8.","error":"RuntimeError: Python version must be >= 3.8.0 to use hyppo>=0.5.0"},{"fix":"Implement the `gradient` method within your `MyCustomKernel` class to define how its gradients are computed.","cause":"If `MyCustomKernel` inherits from `DifferentiableKernel` and you are using `hyppo` v0.5.2 or newer, the `autograd` fallback for gradients was removed. You must now provide your own `gradient` method.","error":"AttributeError: 'MyCustomKernel' object has no attribute 'gradient'"}]}