Scan your whole stack
Are you using hypex?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v2.0.0
hypex was last scanned on 23 Nov 2026 at version 2.0.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 2.0.0 LATEST | 23 Nov 2026 | No rules fired |
Findings for v2.0.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 2.0.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
HypEx (Hypotheses and Experiments) is a library for causal inference and AB testing. It runs the same experiments on pandas for everyday analysis and on Apache Spark for data that does not fit on one machine.
HypEx 2.0 adds an Apache Spark backend, is substantially faster than 1.0.x (most of all on large data, in A/A loops and in matching), and extends the statistical toolkit. See the release notes for the full list.
Dataset runs on pandas or Spark with the same API for AA tests, AB tests, homogeneity tests and
matching.shuffle mode and
co-partitioned search for distributed matching.StatsUTest, matching bias correction and metrics, NaDropper, Float32Caster,
AATest(dry_test=...).ABTest, with a variance reduction report.ABTest (Holm by default, plus Bonferroni, Sidak, FDR and others).Output.resume is now Output.summary, A/A splits
use a different hash, Matching extracts full data and indexes only on request. Version 0.1.x is no longer
supported (pip install hypex==0.1.10).HypEx employs Rubin's Causal Model (RCM) for matching closely related pairs, ensuring equitable group comparisons when estimating treatment effects. Its automated pipeline calculates the Average Treatment Effect (ATE), Average Treatment Effect on the Treated (ATT) and Average Treatment Effect on the Control (ATC), with a standardized interface for running the estimations.
Beyond causal inference, HypEx provides AA tests, homogeneity tests and AB tests (including A/B/n tests with multiple testing corrections and CUPED/CUPAC variance reduction) to rigorously test hypotheses and validate experimental results.
TreatmentRole, TargetRole, FeatureRole, StratificationRole, InfoRole)
and every experiment picks what it needs.Dataset API.Some functions in HypEx help to solve auxiliary tasks but cannot automate decisions on experiment design.
Note: For Matching, it is recommended to use no more than 7 features: more may lead to the curse of dimensionality and make the results unrepresentative.
pip install -U hypex
To pin this release: pip install hypex==2.0.0.
Optional extras for Spark and CUPAC models:
pip install -U "hypex[spark]" # Spark backend
pip install -U "hypex[cat]" # CatBoost
pip install -U "hypex[lgbm]" # LightGBM
pip install -U "hypex[all]" # everything above
Requirements: Python >=3.8, <3.13. The base installation uses pandas and does not include PySpark. The spark extra installs
PySpark 3.5.7; running on Spark also needs Java (8, 11 or 17). Requesting the Spark backend without the extra raises an error
with the installation command.
Explore usage examples and tutorials here.
from hypex.dataset import Dataset, InfoRole, TreatmentRole, TargetRole, FeatureRole
from hypex import Matching
data = Dataset(
roles={
"user_id": InfoRole(int), # InfoRole for ID
"treat": TreatmentRole(int), # TreatmentRole identifies the group (control or target)
"post_spends": TargetRole(float), # TargetRole for the target
},
data="data.csv",
default_role=FeatureRole(), # All remaining columns are features (used to search for similar objects)
)
test = Matching() # Classic matching (Mahalanobis distance + quality tests)
test = Matching(distance="l2") # Choose the distance
test = Matching(n_neighbors=3) # Several neighbors per object
test = Matching(group_match=True) # Match inside groups of categorical features
test = Matching(weights={"age": 2.0}) # Custom feature weights
test = Matching(extract_full_data=True, compute_indexes=True) # Also build full_data and indexes
result = test.execute(data)
result.summary # Summary of results (ATE, ATT, ATC)
result.quality_results # Matching quality tests
result.full_data # Wide dataset with pairs (requires extract_full_data=True)
result.indexes # Matched pairs of indexes, good for join (requires compute_indexes=True)
full_data and indexes are skipped by default because they are expensive on large data.
More about Matching here
from hypex.dataset import Dataset, InfoRole, TargetRole, StratificationRole
from hypex import AATest
data = Dataset(
roles={
"user_id": InfoRole(int), # InfoRole for ID
"pre_spends": TargetRole(), # TargetRole for the homogeneity check
"post_spends": TargetRole(), # TargetRole for the homogeneity check
"gender": StratificationRole(str), # StratificationRole for strata
},
data="data.csv",
)
aa = AATest(n_iterations=10)
result = aa.execute(data)
result.summary # Summary of the whole test
result.aa_score # AA score
result.best_split # The most homogeneous split
result.best_split_statistic # Statistics of the best split
More about AA test here
from hypex import HomogeneityTest
# `data` has a TreatmentRole column and TargetRole columns, as above
result = HomogeneityTest().execute(data)
result.summary
More about the homogeneity test here
from hypex.dataset import Dataset, InfoRole, TreatmentRole, TargetRole
from hypex import ABTest
data = Dataset(
roles={
"user_id": InfoRole(int), # InfoRole for ID
"treat": TreatmentRole(), # TreatmentRole identifies the group (control or target)
"pre_spends": TargetRole(), # TargetRole for A/B(n) tests
"post_spends": TargetRole(), # TargetRole for A/B(n) tests
},
data="data.csv",
)
test = ABTest() # Classic A/B test
test = ABTest(multitest_method="bonferroni") # A/Bn test with Bonferroni correction
test = ABTest(additional_tests=["t-test", "u-test", "chi2-test"]) # Choose the tests
test = ABTest(cuped_features={"post_spends": "pre_spends"}) # CUPED variance reduction
test = ABTest(enable_cupac=True, cupac_models=["linear", "ridge"]) # CUPAC variance reduction
result = test.execute(data)
result.summary # Summary of results
result.multitest # Multiple testing corrections
result.sizes # Group sizes
result.variance_reduction_report # Variance reduction report for CUPED/CUPAC
CUPED uses one pre-experiment value of the target. CUPAC predicts the target from pre-experiment covariates, one model
per time period transition. Its configuration comes from the roles: PreTargetRole(parent=..., lag=...) marks a
historical value of a target, FeatureRole(parent=..., lag=...) a covariate of the same period, and
TargetRole(cofounders=[...]) lists the covariates of the target.
from hypex import ABTest
from hypex.dataset import Dataset, FeatureRole, InfoRole, PreTargetRole, TargetRole, TreatmentRole
data = Dataset(
roles={
"d": TreatmentRole(),
"y": TargetRole(cofounders=["X1", "X2"]),
"y_lag1": PreTargetRole(parent="y", lag=1), # target one period ago
"X1_lag1": FeatureRole(parent="X1", lag=1),
"X2_lag1": FeatureRole(parent="X2", lag=1),
"y_lag2": PreTargetRole(parent="y", lag=2), # target two periods ago
"X1_lag2": FeatureRole(parent="X1", lag=2),
"X2_lag2": FeatureRole(parent="X2", lag=2),
},
data=df,
default_role=InfoRole(), # all other columns are ignored
)
result = ABTest(cuped_features={"y": "y_lag1"}).execute(data) # CUPED
result.variance_reduction_report
# CUPAC: the best model is selected for every transition
result = ABTest(enable_cupac=True, cupac_models=["linear", "ridge", "lasso", "catboost"]).execute(data)
result.cupac.variance_reductions # variance reduction per model
result.cupac.feature_importances # which covariates helped the most
"catboost" requires pip install "hypex[cat]". If cupac_models is omitted, all available models are tried.
Full guide: CUPED & CUPAC tutorial.
More about AB test here
Every experiment above runs on Spark with the same API. Create a SparkSession, pass it to Dataset and select the
backend explicitly. data can be a pandas.DataFrame, it is converted to a Spark DataFrame.
from pyspark.sql import SparkSession
from hypex import AATest
from hypex.dataset import Dataset, InfoRole, TargetRole
from hypex.utils import BackendsEnum
spark = SparkSession.builder.master("local[*]").appName("HypEx").getOrCreate()
data = Dataset(
roles={
"user_id": InfoRole(int),
"pre_spends": TargetRole(),
"post_spends": TargetRole(),
},
data=pandas_df,
session=spark,
backend=BackendsEnum.spark,
)
result = AATest(n_iterations=10, float32=True).execute(data)
result.summary
Notes:
Dataset.data is a pyspark.sql.DataFrame on this backend, so inspect it with the Spark API.dataset.to_backend(BackendsEnum.pandas) or
dataset.to_backend(BackendsEnum.spark, session=spark). Converting a large Spark dataset to pandas is refused when it
would not fit in memory.SmallDataset is pandas-based by design: it holds compact analysis_tables and reporting results.>=3.8, PySpark 3.5.7, Java 8/11/17.Each tutorial has a "Working with the Spark backend" section.
For more detailed information about the library, visit our documentation on ReadTheDocs. It has guides and tutorials to get started and detailed API documentation for advanced use cases.
The architecture of the package (executors, ExperimentData, backends) is described in
hypex/README.md.
Additional architecture documentation and source navigation are available in the DeepWiki codebase overview. This AI-generated resource may lag behind the latest release.
Join our community! For guidelines on contributing, reporting issues or seeking support, please refer to our Contributing Guidelines.
Habr (ru) - discover how HypEx is revolutionizing causal inference in various fields.\ A/B testing seminar - Seminar in NoML about matching and A/B testing\ Matching with HypEx: Simple Guide - Simple matching guide with explanation\ Matching with HypEx: Grouping - Matching with grouping guide\ HypEx vs Causal Inference and DoWhy - discover why HypEx is the best solution for causal inference\ HypEx vs Causal Inference and DoWhy: part 2 - discover why HypEx is the best solution for causal inference
The benchmark follows the methodology of this Kaggle notebook,
adapted to the current Matching API. Within-industry matching searches for neighbors only within the same industry
category; otherwise, neighbors are selected from the full dataset with industry retained as a feature. Missing values are
filled before estimation. Each cell is a single run, excluding data-generation and dataset-construction time.
Environment: Apple M4 Pro with 24 GB RAM, Python 3.11.14, HypEx 2.0.0 (21577a1), DoWhy 0.11.1, causalinference
0.1.3.post1, and PySpark 3.5.1 in local mode with 8 GB driver memory. Causal Inference runs above 65 536 rows did not
complete within a 10-minute timeout or were not run; both cases are marked with —. The fastest result for each group
size is shown in bold.
| Library | Backend | Within-industry matching | 32 768 | 65 536 | 131 072 | 262 144 | 524 288 | 1 048 576 | 2 097 152 | 4 194 304 |
|---|---|---|---|---|---|---|---|---|---|---|
| Causal Inference | Pandas | No | 11.22s | 48.02s | — | — | — | — | — | — |
| DoWhy | Pandas | No | 1.70s | 3.49s | 6.95s | 14.24s | 29.00s | 57.21s | 114.55s | 243.34s |
| HypEx | Pandas | Yes | 0.59s | 0.73s | 1.03s | 2.00s | 4.05s | 8.49s | 19.38s | 59.92s |
| HypEx | Pandas | No | 0.39s | 0.66s | 1.24s | 2.72s | 6.84s | 21.10s | 50.18s | 145.79s |
| HypEx | Spark | Yes | 50.87s | 45.95s | 42.86s | 48.87s | 63.41s | 165.92s | 196.46s | 250.98s |
| HypEx | Spark | No | 14.30s | 15.98s | 15.69s | 20.75s | 81.91s | 92.36s | 108.85s | 118.82s |
Have questions or want to discuss HypEx? Join our Telegram chat and connect with the community and the developers.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.