Skip to content

to_json

Serialize the trained model to a JSON document.

The document holds the training parameters, the fitted metadata and the model (its rating tables), and is read back with from_json. It is larger than the output of to_bytes, but it can be diffed and inspected without t-boost. A loaded model predicts identically to the original. See Saving and loading models.

Method call format

to_json()

Return value

string

Usage examples

with open("model.json", "w") as f:
    f.write(model.to_json())