The watcher.objects.scoring_engine Module

A Scoring Engine is an instance of a data model, to which a learning data was applied.

Because there might be multiple algorithms used to build a particular data model (and therefore a scoring engine), the usage of scoring engine might vary. A metainfo field is supposed to contain any information which might be needed by the user of a given scoring engine.

class watcher.objects.scoring_engine.ScoringEngine(context, **kwargs)[source]

Bases: watcher.objects.base.WatcherObject

create(context=None)[source]

Create a ScoringEngine record in the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
destroy(context=None)[source]

Delete the ScoringEngine from the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
classmethod get(context, scoring_engine_id)[source]

Find a scoring engine based on its id or uuid

Parameters:
  • context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
  • scoring_engine_name – the name of a scoring_engine.
Returns:

a ScoringEngine object.

classmethod get_by_id(context, scoring_engine_id)[source]

Find a scoring engine based on its id

Parameters:
  • context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
  • scoring_engine_id – the id of a scoring_engine.
Returns:

a ScoringEngine object.

classmethod get_by_name(context, scoring_engine_name)[source]

Find a scoring engine based on its name

Parameters:
  • context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
  • scoring_engine_name – the name of a scoring_engine.
Returns:

a ScoringEngine object.

classmethod get_by_uuid(context, scoring_engine_uuid)[source]

Find a scoring engine based on its uuid

Parameters:
  • context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
  • scoring_engine_uuid – the uuid of a scoring_engine.
Returns:

a ScoringEngine object.

classmethod list(context, filters=None, limit=None, marker=None, sort_key=None, sort_dir=None)[source]

Return a list of ScoringEngine objects.

Parameters:
  • context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
  • filters – dict mapping the filter key to a value.
  • limit – maximum number of resources to return in a single result.
  • marker – pagination marker for large data sets.
  • sort_key – column to sort results by.
  • sort_dir – direction to sort. “asc” or “desc”.
Returns:

a list of ScoringEngine objects.

refresh(context=None)[source]

Loads updates for this ScoringEngine.

Loads a scoring_engine with the same id from the database and checks for updated attributes. Updates are applied from the loaded scoring_engine column by column, if there are any updates.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
save(context=None)[source]

Save updates to this ScoringEngine.

Updates will be made column by column based on the result of self.what_changed().

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)
soft_delete(context=None)[source]

soft Delete the ScoringEngine from the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: ScoringEngine(context)

Previous topic

The watcher.objects.goal Module

Next topic

The watcher.objects.strategy Module

Project Source

This Page