primrose.templates package¶
Submodules¶
primrose.templates.awesome_model module¶
Module with AbstractNode implementation, Example model for primrose user modification
- Author(s):
Mike Skarlinski (michael.skarlinski@ww.com)
-
class
primrose.templates.awesome_model.
AwesomeModel
(configuration, instance_name)¶ Bases:
primrose.base.model.AbstractModel
(EXAMPLE MODEL) Print what is going on for each abstract method implementation
Notes
see AbstractModel class to understand how this model is run in each mode!
-
eval_model
(data_object)¶ Code to evaluate your models performance
-
static
necessary_config
(node_config)¶ Returns the necessary configuration keys for the AwesomeModel object
Put your required configuration keys here, here we pass just the base requirement from the abstract class
- Parameters
node_config (dict) – set of parameters / attributes for the node
Note
filename: name of the file
- Returns
set of necessary keys for the AwesomeModel object
-
predict
(data_object)¶ Make predictions using your model
-
train_model
(data_object)¶ Code to train your model and return a data_object after adding any training or model info
-
primrose.templates.awesome_reader module¶
Module with AbstractNode implementation, Example for primrose user modification
- Author(s):
Mike Skarlinski (michael.skarlinski@ww.com)
-
class
primrose.templates.awesome_reader.
AwesomeReader
(configuration, instance_name)¶ Bases:
primrose.base.reader.AbstractReader
(EXAMPLE READER) Read input directly from the configuration file
-
static
necessary_config
(node_config)¶ Returns the necessary configuration keys for the AwesomeReader object
Put your required configuration keys here
- Parameters
node_config (dict) – set of parameters / attributes for the node
Note
filename: name of the file
- Returns
set of necessary keys for the AwesomeReader object
-
run
(data_object)¶ Read data from node_config
- Returns
DataObject instance terminate (bool): should we terminate the DAG? true or false
- Return type
data_object (DataObject)
-
static
primrose.templates.run_plot_dag module¶
-
primrose.templates.run_plot_dag.
main
()¶ Train, evaluate or predict with a machine learning model from a user defined data source The function can optionally upload the results to an external source
-
primrose.templates.run_plot_dag.
parse_arguments
()¶ Parse command line arguments Use environment variables as default if passed. Returns: argument objects with flags as attributes
primrose.templates.run_primrose module¶
Run a job: i.e. run a configuration file through the DAGRunner
-
primrose.templates.run_primrose.
main
()¶ Run a job: i.e. run a configuration file through the DAGRunner
-
primrose.templates.run_primrose.
parse_arguments
()¶ Parse command line arguments
- Returns
argument objects with flags as attributes