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
Copy file name to clipboardExpand all lines: pgml-cms/docs/introduction/apis/sql-extensions/pgml.deploy.md
+14-17Lines changed: 14 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,16 +38,15 @@ The default deployment behavior allows any algorithm to qualify. It's automatica
38
38
39
39
### Deploying the best score
40
40
41
-
\=== "SQL"
41
+
#### SQL
42
42
43
-
```sql
44
-
SELECT*FROMpgml.deploy(
45
-
'Handwritten Digit Image Classifier',
43
+
<preclass="language-sql"><codeclass="lang-sql"><strong>SELECT * FROM pgml.deploy(
44
+
</strong> 'Handwritten Digit Image Classifier',
46
45
strategy => 'best_score'
47
46
);
48
-
```
47
+
</code></pre>
49
48
50
-
\=== "Output"
49
+
#### Output
51
50
52
51
```sql
53
52
project | strategy | algorithm
@@ -56,13 +55,11 @@ SELECT * FROM pgml.deploy(
56
55
(1 row)
57
56
```
58
57
59
-
\===
60
-
61
58
### **Specific Algorithms**
62
59
63
60
Deployment candidates can be restricted to a specific algorithm by including the `algorithm` parameter. This is useful when you're training multiple algorithms using different hyperparameters and want to restrict the deployment a single algorithm only:
64
61
65
-
\=== "SQL"
62
+
#### SQL
66
63
67
64
```sql
68
65
SELECT*FROMpgml.deploy(
@@ -72,7 +69,7 @@ SELECT * FROM pgml.deploy(
72
69
);
73
70
```
74
71
75
-
\=== "Output"
72
+
#### Output
76
73
77
74
```sql
78
75
project_name | strategy | algorithm
@@ -81,13 +78,13 @@ SELECT * FROM pgml.deploy(
81
78
(1 row)
82
79
```
83
80
84
-
\===
81
+
85
82
86
83
### Rolling Back
87
84
88
85
In case the new model isn't performing well in production, it's easy to rollback to the previous version. A rollback creates a new deployment for the old model. Multiple rollbacks in a row will oscillate between the two most recently deployed models, making rollbacks a safe and reversible operation.
89
86
90
-
\=== "Rollback 1"
87
+
#### Rollback
91
88
92
89
```sql
93
90
SELECT*FROMpgml.deploy(
@@ -96,7 +93,7 @@ SELECT * FROM pgml.deploy(
96
93
);
97
94
```
98
95
99
-
\=== "Output"
96
+
#### Output
100
97
101
98
```sql
102
99
project | strategy | algorithm
@@ -105,7 +102,9 @@ SELECT * FROM pgml.deploy(
105
102
(1 row)
106
103
```
107
104
108
-
\=== "Rollback 2"
105
+
#### Rollback again
106
+
107
+
Rollbacks are actually new deployments, so issuing two rollbacks in a row will leave you back with the original model, making rollback safely undoable.
0 commit comments