neuraxle.metaopt.repositories.db¶
Module-level documentation for neuraxle.metaopt.repositories.db. Here is an inheritance diagram, including dependencies to other base modules of Neuraxle:
Neuraxle’s SQLAlchemy Hyperparameter Repository Classes¶
Data objects and related repositories used by AutoML, SQL version.
Classes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
class
neuraxle.metaopt.repositories.db.
ScopedLocationTreeNode
(dataclass_node, parent=None)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
-
_set_location_from
(dataclass_node: neuraxle.metaopt.repositories.db.DataClassNode, parent=None)[source]¶
-
loc
¶
-
id_attr_value
¶
-
static
query
(session: sqlalchemy.orm.session.Session, scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep=False) → Optional[neuraxle.metaopt.repositories.db.ScopedLocationTreeNode][source]¶
-
_sa_class_manager
= {'client_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dataclass_node': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'metric_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parent_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'project_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'round_number': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'split_number': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'subdataclasses': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'trial_number': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
DataClassTreeNodeUpdater
(session: sqlalchemy.orm.session.Session, scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep: bool = False)[source]¶ Bases:
object
-
__init__
(session: sqlalchemy.orm.session.Session, scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep: bool = False)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
add_or_update_dataclass
(_dataclass: SubDataclassT, parent: Optional[neuraxle.metaopt.repositories.db.ScopedLocationTreeNode])[source]¶ Add or update a dataclass in the database.
Possible scenarios: - dataclass is not in the database:
- add it to the database. Recursively:
add all subdataclasses
- dataclass is in the database:
- update it in the database. Recursively, for all subdataclasses wheter found or not:
add all subdataclasses
update all subdataclasses
This means we have the following methods chaining into each other: - add or update dataclass - update dataclass - add dataclass
-
-
class
neuraxle.metaopt.repositories.db.
DataClassNode
(_dataclass=None)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
-
_sa_class_manager
= {'id_attr_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'logs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
ProjectNode
(_dataclass=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.DataClassNode
-
_sa_class_manager
= {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id_attr_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'logs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'project_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
ClientNode
(_dataclass=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.DataClassNode
-
_sa_class_manager
= {'client_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id_attr_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'logs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
RoundNode
(_dataclass=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.DataClassNode
-
_sa_class_manager
= {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id_attr_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'logs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'main_metric_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'round_number': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
BaseTrialNodeMixin
[source]¶ Bases:
object
-
hyperparams
= Column(None, JSON(), table=None, nullable=False, default=ColumnDefault(<function dict>))[source]¶
-
status
= Column(None, String(), table=None, nullable=False, default=ColumnDefault('PLANNED'))[source]¶
-
created_time
= Column(None, DateTime(), table=None, nullable=False, default=ColumnDefault(<sqlalchemy.sql.functions.now at 0x7f57111b8b80; now>))[source]¶
-
start_time
= Column(None, DateTime(), table=None, default=ColumnDefault(<sqlalchemy.sql.functions.now at 0x7f57111b8f10; now>))[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
TrialNode
(_dataclass=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.BaseTrialNodeMixin
,neuraxle.metaopt.repositories.db.DataClassNode
-
_sa_class_manager
= {'created_time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'end_time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'hyperparams': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id_attr_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'logs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'start_time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'status': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'trial_number': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
TrialSplitNode
(_dataclass=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.BaseTrialNodeMixin
,neuraxle.metaopt.repositories.db.DataClassNode
-
_update_attrs_from_dataclass
(_dataclass: neuraxle.metaopt.data.vanilla.TrialSplitDataclass)[source]¶
-
_sa_class_manager
= {'created_time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'end_time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'hyperparams': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id_attr_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'logs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'split_number': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'start_time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'status': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
MetricResultsNode
(_dataclass=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.DataClassNode
-
_update_attrs_from_dataclass
(_dataclass: neuraxle.metaopt.data.vanilla.MetricResultsDataclass)[source]¶
-
_sa_class_manager
= {'higher_score_is_better': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id_attr_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'logs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'metric_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'train_values': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tree_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'valid_values': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
MetricResultsValuesMixin
[source]¶ Bases:
object
-
class
neuraxle.metaopt.repositories.db.
TrainMetricResultsValues
(value, _datetime=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.MetricResultsValuesMixin
,sqlalchemy.orm.decl_api.Base
-
_sa_class_manager
= {'datetime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'metric_results_node': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'metric_results_node_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
ValidMetricResultsValues
(value, _datetime=None)[source]¶ Bases:
neuraxle.metaopt.repositories.db.MetricResultsValuesMixin
,sqlalchemy.orm.decl_api.Base
-
_sa_class_manager
= {'datetime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'metric_results_node': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'metric_results_node_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
AutoMLLog
(**kwargs)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
-
__init__
(**kwargs)[source]¶ A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
_sa_class_manager
= {'dataclass_node': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dataclass_node_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'datetime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'log_text': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}[source]¶
-
-
class
neuraxle.metaopt.repositories.db.
_DatabaseLoggerHandlerMixin
[source]¶ Bases:
object
Mixin to add a in-memory logging handler to a repository.
-
class
neuraxle.metaopt.repositories.db.
DatabaseHyperparamRepository
(engine, session)[source]¶ Bases:
neuraxle.metaopt.repositories.db._DatabaseLoggerHandlerMixin
,neuraxle.metaopt.repositories.repo.HyperparamsRepository
-
load
(scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep=False) → SubDataclassT[source]¶ Get metadata from scope.
The fetched metadata will be the one that is the last item that is not a None in the provided scope.
- Parameters
scope (
ScopedLocation
) – scope to get metadata from.- Returns
metadata from scope.
-
save
(_dataclass: SubDataclassT, scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep=False) → neuraxle.metaopt.repositories.repo.HyperparamsRepository[source]¶ Save metadata to scope.
- Parameters
metadata – metadata to save.
scope (
ScopedLocation
) – scope to save metadata to.deep (
bool
) – if True, save metadata’s sublocations recursively.
-
_abc_impl
= <_abc_data object>¶
-
-
class
neuraxle.metaopt.repositories.db.
SQLLiteHyperparamsRepository
(sqllite_db_path, echo=False)[source]¶ Bases:
neuraxle.metaopt.repositories.db.DatabaseHyperparamRepository
-
__init__
(sqllite_db_path, echo=False)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
_abc_impl
= <_abc_data object>¶
-
-
class
neuraxle.metaopt.repositories.db.
PostGreSQLHyperparamsRepository
(postgresql_db_path, echo=False)[source]¶ Bases:
neuraxle.metaopt.repositories.db.DatabaseHyperparamRepository
-
_abc_impl
= <_abc_data object>¶
-