Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28545c9

Browse files
committed
more fixes
1 parent85010b3 commit28545c9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎pgml/pgml/model.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ def data(self):
208208

209209
# Sanity check the data
210210
iflen(data)==0:
211-
PgMLException(
211+
raisePgMLException(
212212
f"Relation `{self.relation_name}` contains no rows. Did you pass the correct `relation_name`?"
213213
)
214214
ifself.y_column_namenotindata[0]:
215-
PgMLException(
215+
raisePgMLException(
216216
f"Column `{self.y_column_name}` not found. Did you pass the correct `y_column_name`?"
217217
)
218218

@@ -428,6 +428,10 @@ def train(
428428
algorithms= ["linear","random_forest"]
429429
elifobjective=="classification":
430430
algorithms= ["random_forest"]
431+
else:
432+
raisePgMLException(
433+
f"Unknown objective '{objective}', available options are: regression, classification"
434+
)
431435

432436
foralgorithm_nameinalgorithms:
433437
model=Model.create(project,snapshot,algorithm_name)

‎sql/install.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ $$ LANGUAGE plpython3u;
103103
---
104104
--- Regression
105105
---
106-
DROPFUNCTIONpgml.train(project_nameTEXT, objectiveTEXT, relation_nameTEXT, y_column_nameTEXT);
106+
DROPFUNCTIONIF EXISTSpgml.train(project_nameTEXT, objectiveTEXT, relation_nameTEXT, y_column_nameTEXT);
107107
CREATE OR REPLACEFUNCTIONpgml.train(project_nameTEXT, objectiveTEXT, relation_nameTEXT, y_column_nameTEXT)
108-
RETURNSTEXT
108+
RETURNSTABLE(project_nameTEXT, objectiveTEXT, statusTEXT)
109109
AS $$
110110
frompgml.model import train
111111

112112
train(project_name, objective, relation_name, y_column_name)
113113

114-
return"OK"
114+
return[(project_name, objective,"deployed")]
115115
$$ LANGUAGE plpython3u;
116116

117117
---

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp