Operations Utilities API

jange.ops.utils.disable_training(ops: List[jange.base.Operation]) → List[jange.base.Operation][source]

Disables the “training mode” of operations so that these operations can be used for inference.

Some operations like tfidf, kmeans, sgd etc. need to learn from the data and by default they are in “training mode” which will learn from the stream that is passed to them. Once these have been trained we want to use it in production so we need to disable the training.

Example

>>> with ops.utils.disable_training(stream.applied_ops) as new_ops:
>>>     ops.utils.save(new_ops, path="./operations")
Parameters:ops (List[Operation]) – a list of operations