architxt.cli.utils#
Functions
|
Load a forest from a list of binary files. |
|
Serialize and save the forest object to a buffer. |
|
|
|
- architxt.cli.utils.load_forest(files, *, sample=0, shuffle=False)[source]#
Load a forest from a list of binary files.
- Parameters:
- Return type:
- Returns:
A list containing the deserialized forest data.
>>> forest = load_forest(['forest1.pkl', 'forest2.pkl'], sample=100, shuffle=True)
- architxt.cli.utils.save_forest(forest, output)[source]#
Serialize and save the forest object to a buffer.
- Parameters:
forest (
Collection
[Tree
]) – The forest object to be serialized and saved.output (
Union
[BytesIO
,BinaryIO
]) – The buffer or file-like object where the forest will be saved.
>>> with open('forest.pkl', 'wb') as f: ... save_forest(forest, f)
- Return type: