You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Model: that should currently be used for predictions
110
+
"""
67
111
ifself._deployed_modelisNone:
68
112
self._deployed_model=Model.find_deployed(self.id)
69
113
returnself._deployed_model
70
114
71
115
classSnapshot(object):
116
+
"""
117
+
Snapshots capture a set of training & test data for repeatability.
118
+
119
+
Attributes:
120
+
id (int): a unique identifier
121
+
relation_name (str): the name of the table or view to snapshot
122
+
y_column_name (str): the label for training data
123
+
test_size (float or int, optional): If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If int, represents the absolute number of test samples. If None, the value is set to the complement of the train size. If train_size is also None, it will be set to 0.25.
124
+
test_sampling (str, optional): How to sample to create the test data. Defaults to "random". Valid values are ["first", "last", "random"].
125
+
status (str): The current status of the snapshot, e.g. 'new' or 'created'
126
+
created_at (Timestamp): when this snapshot was created
127
+
updated_at (Timestamp): when this snapshot was last updated
This creates both a metadata record in the snapshots table, as well as creating a new table
135
+
that holds a snapshot of all the data currently present in the relation so that training
136
+
runs may be repeated, or further analysis may be conducted against the input.
137
+
138
+
Args:
139
+
relation_name (str): the name of the table or view to snapshot
140
+
y_column_name (str): the label for training data
141
+
test_size (float or int, optional): If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If int, represents the absolute number of test samples. If None, the value is set to the complement of the train size. If train_size is also None, it will be set to 0.25.
142
+
test_sampling: (str, optional): How to sample to create the test data. Defaults to "random". Valid values are ["first", "last", "random"].
143
+
Returns:
144
+
Snapshot: metadata instantiated from the database
145
+
"""
146
+
74
147
snapshot=Snapshot()
75
148
snapshot.__dict__=dict(plpy.execute(f"""
76
149
INSERT INTO pgml.snapshots (relation_name, y_column_name, test_size, test_sampling, status)