Tests one factor. Screens a thousand.
What factrix does
factrix is a Polars-native toolkit for testing whether a candidate factor has predictive evidence. It provides factor-type-specific tests for cross-sectional, event, and common factors, and rejects metric/data combinations that do not apply.
- Inference built for factor data — overlap-aware standard errors, persistence diagnostics, and event-study methods.
- Batch screening — false-discovery-rate control for testing many factors.
- Structured results — estimates, p-values, metadata, and warnings remain separate instead of being collapsed into one score.
factrix covers factor inference and screening. Portfolio construction, backtesting, and execution remain downstream; see Where factrix fits for the scope boundary and neighbouring tools.
Installation
pip install factrix
# or
uv add factrix
See the installation guide for version pinning and development setup.
Quickstart
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, rng=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))
The minimum input is a long Polars frame keyed by date and asset_id, with
a factor column and forward_return. Read the returned p_value together with
the result's sample metadata and warnings; the
quickstart
shows the complete result shape.
Next steps
- Preparing data — validate and align your own panel.
- Choosing a metric — map a research question to a metric.
- Multi-factor screening — BHY false-discovery-rate control across candidate factors.
- Multi-horizon evaluation — sweeping
forward_periodswithevaluate_horizons. - Panel vs timeseries — understand data-shape dispatch.
Documentation
- Get started — installation and quickstart
- User guide — concepts, how-to guides, examples, and reference tables
- API reference — entry points, result types, and per-metric pages
- Development — contribution and design guidance
- Release notes — changelog
License
Released under the Apache License 2.0.
Metadata
Release files for factrix 0.32.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.32.0.tar.gz | 771.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| factrix-0.32.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / factrix-0.32.0.tar.gz
| Download URL | factrix-0.32.0.tar.gz |
|---|---|
| Size | 771.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b8e3e1098c253aa4ae05c50edc9c731017618f9f221f6cd672890d9d005a592
|
|
BLAKE2b-256 checksum How to use checksums |
5a86f2f1ecf67712db3943ac280f1ed2d88cf5d0d73ec79544d359b00b804f06
|
| 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 Sep 3, 2026.
Transparency logRelease files / factrix-0.32.0-py3-none-any.whl
| Download URL | factrix-0.32.0-py3-none-any.whl |
|---|---|
| Size | 549.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68a652bdec28eda6b91a1bb82abe30ddfc62d80462b5f094e3fc2a03f5a4e221
|
|
BLAKE2b-256 checksum How to use checksums |
90e2cc7c9ff82de73dcee9901f52df582073dd85626aaceb4ec551bcf7d34c27
|
| 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 Sep 3, 2026.
Transparency log