simpleml.utils.training.create_persistable module¶
Module with helper classes to create new persistables
-
class
simpleml.utils.training.create_persistable.
DatasetCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(registered_name, dataset_pipeline=None, **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
(name='', version=None, 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.
DatasetPipelineCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(registered_name, raw_dataset=None, **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
- raw_dataset – raw dataset object
-
classmethod
determine_filters
(name='', version=None, 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.
MetricCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(registered_name, model=None, **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
(name=None, model_id=None, 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
(registered_name, pipeline=None, **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
(name='', version=None, 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:
object
-
create
(**kwargs)[source]¶ method to create a new persistable with the desired parameters kwargs are passed directly to persistable
-
determine_filters
(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
-
static
retrieve_dependency
(dependency_cls, **dependency_kwargs)[source]¶ Base method to query for dependency Raises TrainingError if dependency does not exist
-
-
class
simpleml.utils.training.create_persistable.
PipelineCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(registered_name, dataset=None, **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
(name='', version=None, 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.
RawDatasetCreator
[source]¶ Bases:
simpleml.utils.training.create_persistable.PersistableCreator
-
classmethod
create
(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
-
classmethod
determine_filters
(name='', version=None, 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