simpleml.utils.training.create_persistable
¶
Module with helper classes to create new persistables
Module Contents¶
Classes¶
-
class
simpleml.utils.training.create_persistable.
DatasetCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(cls, registered_name, **kwargs)[source]¶ Stateless method to create a new persistable with the desired parameters kwargs are passed directly to persistable
- Parameters
registered_name – Class name registered in SimpleML
dataset_pipeline – dataset pipeline object
-
classmethod
determine_filters
(cls, strict=True, **kwargs)[source]¶ stateless method to determine which filters to apply when looking for existing persistable
Returns: database class, filter dictionary
- Parameters
registered_name – Class name registered in SimpleML
strict – whether to assume same class and name = same persistable,
or, load the data and compare the hash
-
classmethod
-
class
simpleml.utils.training.create_persistable.
MetricCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(cls, registered_name, **kwargs)[source]¶ Stateless method to create a new persistable with the desired parameters kwargs are passed directly to persistable
- Parameters
registered_name – Class name registered in SimpleML
model – model class
-
classmethod
determine_filters
(cls, strict=False, **kwargs)[source]¶ stateless method to determine which filters to apply when looking for existing persistable
Returns: database class, filter dictionary
- Parameters
registered_name – Class name registered in SimpleML
strict – whether to fit objects first before assuming they are identical
In theory if all inputs and classes are the same, the outputs should deterministically be the same as well (up to random iter). So, you dont need to fit objects to be sure they are the same
-
classmethod
-
class
simpleml.utils.training.create_persistable.
ModelCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(cls, registered_name, **kwargs)[source]¶ Stateless method to create a new persistable with the desired parameters kwargs are passed directly to persistable
- Parameters
registered_name – Class name registered in SimpleML
pipeline – pipeline object
-
classmethod
determine_filters
(cls, strict=False, **kwargs)[source]¶ stateless method to determine which filters to apply when looking for existing persistable
Returns: database class, filter dictionary
- Parameters
registered_name – Class name registered in SimpleML
strict – whether to fit objects first before assuming they are identical
In theory if all inputs and classes are the same, the outputs should deterministically be the same as well (up to random iter). So, you dont need to fit objects to be sure they are the same
-
classmethod
-
class
simpleml.utils.training.create_persistable.
PersistableCreator
[source]¶ Bases:
future.utils.with_metaclass()
-
abstract
create
(cls, **kwargs)[source]¶ method to create a new persistable with the desired parameters kwargs are passed directly to persistable
-
abstract
determine_filters
(cls, strict=False, **kwargs)[source]¶ method to determine which filters to apply when looking for existing persistable
- Parameters
strict – whether to fit objects first before assuming they are identical
In theory if all inputs and classes are the same, the outputs should deterministically be the same as well (up to random iter). So, you dont need to fit objects to be sure they are the same
- Default design iterates through 2 (or 3) options when retrieving persistables:
By name and version (unique properties that define persistables)
2) By name, registered_name, and computed hash 2.5) Optionally, just use name and registered_name (assumes class
definition is the same and would result in an identical persistable)
Returns: database class, filter dictionary
-
static
retrieve
(cls, filters)[source]¶ Query database using the table model (cls) and filters for a matching persistable
-
classmethod
retrieve_dataset
(cls, dataset=None, dataset_id: str = None, dataset_kwargs=None, **kwargs)[source]¶
-
static
retrieve_dependency
(dependency_cls, **dependency_kwargs)[source]¶ Base method to query for dependency Raises TrainingError if dependency does not exist
-
static
retrieve_from_registry
(registered_name)[source]¶ stateless method to query registry for class definitions. handles errors
-
classmethod
retrieve_model
(cls, model=None, model_id: str = None, model_kwargs=None, **kwargs)[source]¶
-
abstract
-
class
simpleml.utils.training.create_persistable.
PipelineCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(cls, registered_name, **kwargs)[source]¶ Stateless method to create a new persistable with the desired parameters kwargs are passed directly to persistable
- Parameters
registered_name – Class name registered in SimpleML
dataset – dataset object
-
classmethod
determine_filters
(cls, strict=False, **kwargs)[source]¶ stateless method to determine which filters to apply when looking for existing persistable
Returns: database class, filter dictionary
- Parameters
registered_name – Class name registered in SimpleML
strict – whether to fit objects first before assuming they are identical
In theory if all inputs and classes are the same, the outputs should deterministically be the same as well (up to random iter). So, you dont need to fit objects to be sure they are the same
-
classmethod