from_settings#

from_settings(node) builds a fresh function from {"type": T, "settings": {...}}: the "object" of a save file, or a dict made from a function's settings(). A "state" in the node is ignored, so the new function starts from no data, as scikit-learn's clone does.

settings() returns a function's constructor arguments by name, with defaults filled in and None for an optional argument that was not given. Use from_settings to rebuild a function whose saved state another release cannot read, then warm it up with resume on history. An unknown type, an unknown setting or a setting the constructor refuses raises SaveError. In JavaScript the call is fromSettings(node).

Examples#

import screamer

f = screamer.RollingZscore(20)
print(f.settings())

g = screamer.from_settings({"type": "RollingZscore", "settings": f.settings()})
print(g)
{'window_size': 20, 'start_policy': 'strict'}
RollingZscore(window_size=20, start_policy='strict')

Signature#

from_settings(node)

  • node - a dict with "type" (the class name) and "settings".

Used in the Guide#

See also#

  • load: Read a file that save wrote and return the function, Pipeline or live session it holds

  • loads: Read a save file from a string or bytes and return the object it holds

  • resume: The batch call that starts from a function's state and keeps the end state