Formulaic

Latest version: v1.0.1

Safety actively analyzes 642283 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.6.2

This is a minor release with several bugfixes.

**Bugfixes and cleanups:**

* Fixed issues handling empty data sets in formulae that used categorical
encoding.
* Added the MIT license to distribution classifiers.

0.6.1

This is a minor release with one new feature.

**New features and enhancements:**

* Added support for treating individual categorical features as though they do not span the intercept (useful for intentionally generating over-specified model matrices in e.g. regularized models).

0.6.0

This is a major release with some important consistency and completeness
improvements. It should be treated as *almost* being the first release candidate
of 1.0.0, which will land after some small amount of further feature extensions
and documentation improvements.

**Breaking changes:**

Although there are some internal changes to API, as documented below, there are
no breaking changes to user-facing APIs.

**New features and enhancements:**

* Formula terms are now consistently ordered regardless of providence (formulae or
manual term specification), and sorted according to R conventions by default
rather than lexically. This can be changed using the `_ordering` keyword to
the `Formula` constructor.
* Greater compatibility with R and patsy formulae:
* for patsy: added `standardize`, `Q` and treatment contrasts shims.
* for patsy: added `cluster_by='numerical_factors` option to `ModelSpec` to enable
patsy style clustering of output columns by involved numerical factors.
* for R: added support for exponentiation with `^` and `%in%`.
* Diff and Helmert contrast codings gained support for additional variants.
* Greatly improved the performance of generating sparse dummy encodings when
there are many categories. 110 112 (thanks dbalabka)
* Context scoping operators (like paretheses) are now tokenized as their own special
type.
* Add support for merging `Structured` instances, and use this functionality during
AST evaluation where relevant.
* `ModelSpec.term_indices` is now a list rather than a tuple, to allow direct use when
indexing pandas and numpy model matrices.
* Add official support for Python 3.11.

**Bugfixes and cleanups:**

* Fix parsing formulae starting with a parenthesis.
* Fix iteration over root nodes of `Structured` instances for non-sequential iterable values.
* Bump testing versions and fix `poly` unit tests.
* Fix use of deprecated automatic casting of factors to numpy arrays during dense
column evaluation in `PandasMaterializer`. 122 (thanks effigies)
* `Factor.EvalMethod.UNKNOWN` was removed, defaulting instead to `LOOKUP`.
* Remove `sympy` version constraint now that a bug has been fixed upstream.

**Documentation:**

* Substantial updates to documentation, which is now mostly complete for end-user
use-cases. Developer and API docs are still pending.

0.5.2

This is a minor patch releases that fixes one bug.

**Bugfixes and cleanups:**

* Fixed alignment between the length of a `Structured` instance and iteration
over this instance (including `Formula` instances). Formerly the length would
only count the number of keys in its structure, rather than the number of
objects that would be yielded during iteration.

0.5.1

This is a minor patch release that fixes two bugs.

**Bugfixes and cleanups:**

* Fixed generation of string representation of `Formula` objects.
* Fixed generation of `formulaic.__version__` during package build.

0.5.0

This is a major new release with some minor API changes, some ergonomic
improvements, and a few bug fixes.

**Breaking changes:**

* Accessing named substructures of `Formula` objects (e.g. `formula.lhs`) no
longer returns a list of terms; but rather a `Formula` object, so that the
helper methods can remain accessible. You can access the raw terms by
iterating over the formula (`list(formula)`) or looking up the root node
(`formula.root`).

**New features and improvements:**

* The `ModelSpec` object is now the source of truth in all `ModelMatrix`
generations, and can be constructed directly from any supported specification
using `ModelSpec.from_spec(...)`. Supported specifications include formula
strings, parsed formulae, model matrices and prior model specs.
* The `.get_model_matrix()` helper methods across `Formula`,
`FormulaMaterializer`, `ModelSpec` and `model_matrix` objects/helpers
functions are now consistent, and all use `ModelSpec` directly under the hood.
* When accessing substructures of `Formula` objects (e.g. `formula.lhs`), the
term lists will be wrapped as trivial `Formula` instances rather than returned
as raw lists (so that the helper methods like `.get_model_matrix()` can still
be used).
* `FormulaSpec` is now exported from the top-level module.

**Bugfixes and cleanups:**

* Fixed `ModelSpec` specifications being overriden by default arguments to
`FormulaMaterializer.get_model_matrix`.
* `Structured._flatten()` now correctly flattens unnamed substructures.

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.