Skip to main content

FittedRecipe.to_json()

Serialize to a diffable JSON string. See mlfeatures.to_json.

Usage

Source

FittedRecipe.to_json(
    *,
    indent=2,
)

JSON needs no optional dependency and is readable by any tool, so it is the default choice for storing a recipe next to a model.

Parameters

indent: int = 2
Spaces of indentation per level. Defaults to 2.

Returns

str
The JSON text. Load it again with FittedRecipe.from_json.

Raises

TypeError
As for FittedRecipe.to_dict.

Warns

UserWarning
As for FittedRecipe.to_dict.