The watcher.objects.scoring_engine Module

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=None, **kwargs)[source]

Bases: watcher.objects.base.WatcherPersistentObject, watcher.objects.base.WatcherObject, watcher.objects.base.WatcherObjectDictCompat

create(*args, **kwargs)[source]

Create a ScoringEngine record in the DB.

destroy()[source]

Delete the ScoringEngine from the DB

classmethod get(context, *args, **kwargs)[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, *args, **kwargs)[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, *args, **kwargs)[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, *args, **kwargs)[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, *args, **kwargs)[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()[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.

save(*args, **kwargs)[source]

Save updates to this ScoringEngine.

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

soft_delete()[source]

Soft Delete the ScoringEngine from the DB

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.