Skip to content

flowmachine.core.model

Source: flowmachine/core/model.py

Model is an abstract base class for models - features which are calculated outside of the database. In addition, it provides a decorator - model_result, which should be used with the run method of a model. This will check for cached results for the run parameters, and return the cache in preference to running the model.

Class Model

Model()
Source: flowmachine/core/model.py

Abstract base class for models.

Methods

run

run(self, *args, **kwargs)
Source: flowmachine/core/model.py

Method which runs the model.

Returns
  • flowmachine.core.model_result.ModelResult

model_result

model_result(f)
Source: flowmachine/core/model.py

A decorator which creates a ModelResult object, and handles checking if the results of run are cached, returns them if so and converts the DataFrame returned by run into a ModelResult.

Parameters

  • f: function

    run function to wrap

Returns

  • function