Formulaic is a library for converting statistical model formulas into numerical representations suitable for fitting statistical and machine learning models. It implements Wilkinson-style formula notation, which provides a concise way to describe relationships between variables.
In statistical modelling, formulas are commonly used to specify dependent variables, predictors, interactions, and transformations. These expressions must be converted into model matrices before numerical estimation can take place.
Formulaic provides a flexible implementation of this process, with particular attention to performance, extensibility, and consistency when the same transformations are applied to different datasets.
This is free and open source software.
Key Features
- Parses Wilkinson-style statistical formulas into structured model specifications.
- Converts tabular data into design matrices for statistical estimation.
- Supports categorical predictors and the generation of appropriate encoded variables.
- Handles interactions and transformations expressed through formula notation.
- High-performance conversion of DataFrames into dense or sparse model matrices.
- Preserves encoding decisions so that transformations can be reused with other datasets.
- Supports extensible formula parsing and custom interpretation of formula expressions.
- Works with pandas DataFrames and compatible alternative tabular data representations.
- Provides integration with Arrow and Polars data structures through supported interfaces.
- Generates outputs as NumPy arrays, pandas DataFrames, and SciPy sparse matrices.
- Supports symbolic differentiation of formulas and their corresponding model matrices.
- Separates formula evaluation from data representation through extensible input and output interfaces.
- Can be incorporated into regression, survival analysis, and other statistical modelling workflows.
Website: github.com/matthewwardrop/formulaic
Support:
Developer: Matthew Wardrop
License: MIT License
Formulaic is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| Python Mathematics Tools | |
|---|---|
| scikit-learn | Machine learning library for Python |
| NumPy | Core package for scientific computing with Python |
| SciPy | Ecosystem for mathematics, science, and engineering. |
| statsmodels | Statistical modeling and econometrics |
| JAX | Python library for high-performance numerical computing |
| SageMath | Computer algebra system |
| SymPy | Library for symbolic mathematics |
| PyMC | Bayesian statistical modeling and probabilistic programming |
| Pyomo | Object-oriented algebraic modeling language |
| patsy | Package for describing statistical models and to build design matrices |
| mpmath | Library for arbitrary-precision floating-point arithmetic |
| SfePy | Finite element software package |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.