Tests one factor. Screens a thousand.
Where factrix fits
Does this factor possess predictive edge?
factrix is the first Polars-native Python toolkit that picks the right statistical test for each factor type. Cross-sectional, event, common factor — each gets the tests that fit its data-generating process.
factor construction → factrix (inference) → strategy construction → backtest → live trading
▲ you are here
For each candidate factor factrix answers — is the predictive power real? — and corrects for multiple testing when you screen at scale. Kill fakes before they cost you a backtest.
Why factrix?
- Type-routed evaluation — Information Coefficient + Fama-MacBeth for cross-sectional factors; Cumulative Average Abnormal Return for events.
- Financial statistics built in — autocorrelation-robust standard errors (Newey-West), overlapping-forward-return correction, persistent-predictor flagging (Stambaugh bias), and false-discovery-rate control across batches (Benjamini-Hochberg-Yekutieli).
- Polars-native — modern Polars alternative to the pandas-based alphalens.
factrix stops at the inference — primary test plus diagnostic battery. It does not size positions, model slippage, optimise weights, or compose alphas; those belong to the later stages of the pipeline.
Is factrix the right tool?
| You want to… | Use this |
|---|---|
| Inference on a factor (cross-sectional / event / common factor) | factrix |
| Screen many factors with multiple-testing correction | factrix |
| Backtest with positions / slippage / margin | zipline-reloaded, backtrader, bt, vectorbt, nautilus_trader |
| Optimise portfolio weights | skfolio, riskfolio-lib |
| Returns-level tear-sheet (P&L diagnostics) | pyfolio-reloaded, QuantStats |
| Familiar cross-sectional tear-sheet | alphalens-reloaded |
| End-to-end machine-learning pipeline | qlib |
| Deflated / probabilistic Sharpe today (commercial) | mlfinlab |
Installation
pip install factrix
# or
uv add factrix
See the installation guide for version pinning and development setup.
Typical usage
Single factor — IC evaluation
import factrix as fx
from factrix.metrics import ic
raw = fx.datasets.make_cs_panel(n_assets=100, n_dates=500, ic_target=0.08, seed=2024)
data = fx.preprocess.compute_forward_return(raw, forward_periods=5)
results = fx.evaluate(
data,
metrics={"ic": ic(inference=fx.inference.NEWEY_WEST)},
factor_cols=["factor"],
forward_periods=5,
)
res = results["factor"]
ic_res = res.metrics["ic"]
print('ic_mean =', round(ic_res.value, 4))
print('p_value =', round(ic_res.p_value, 4))
More scenarios, runnable end to end:
- Quickstart — same example, plus
.to_dict()output and warnings. - Multi-factor screening — BHY false-discovery-rate control across candidate factors.
- Multi-horizon evaluation — sweeping
forward_periodswithevaluate_horizons. - PANEL vs TIMESERIES — single-asset evaluation with
predictive_beta.
Documentation
- Get Started — install, quickstart, where factrix fits
- User Guide — concepts (three-axis design, architecture), how-to (PANEL vs TIMESERIES, BHY screening, slice analysis), examples
- API Reference — entry points, results, lookup tables, per-metric pages
- Development — contributing, design notes
- Release Notes — changelog
License
Released under the Apache License 2.0.
Metadata
Release files for factrix 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| factrix-0.20.0.tar.gz | 450.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| factrix-0.20.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 817.6 kB
Release files / factrix-0.20.0.tar.gz
| Download URL | factrix-0.20.0.tar.gz |
|---|---|
| Size | 450.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8e483b8930651c7fb59d670969dd671539c954b5ab6df90ecada7b4fcb3a4ee
|
|
BLAKE2b-256 checksum How to use checksums |
1ff7c5fb63a2c3aa6778af1f665b6d84d35fe134745b0d160243942c10b39d47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / factrix-0.20.0-py3-none-any.whl
| Download URL | factrix-0.20.0-py3-none-any.whl |
|---|---|
| Size | 366.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
21948fb90ef9f50ecb56e4d049ef514ba00982a72d537e92ad68b8fb228afabe
|
|
BLAKE2b-256 checksum How to use checksums |
9aa8b2b749c1b56b88c25930767b84ab0fee4007af98afab42119c8c833f3004
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency log