MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / ExecutePredict

Method ExecutePredict

go/executor/executor.go:246–263  ·  view source on GitHub ↗
(cl *ir.PredictStmt)

Source from the content-addressed store, hash-verified

244}
245
246func (s *pythonExecutor) ExecutePredict(cl *ir.PredictStmt) (e error) {
247 // NOTE(typhoonzero): model is already loaded under s.Cwd
248 if e = createPredictionResultTable(cl, s.Db, s.Session); e != nil {
249 return e
250 }
251
252 var code string
253 if cl.TrainStmt.GetModelKind() == ir.XGBoost {
254 if code, e = xgboost.Pred(cl, s.Session); e != nil {
255 return e
256 }
257 } else {
258 if code, e = tensorflow.Pred(cl, s.Session); e != nil {
259 return e
260 }
261 }
262 return s.runProgram(code, false)
263}
264
265func (s *pythonExecutor) ExecuteExplain(cl *ir.ExplainStmt) error {
266 // NOTE(typhoonzero): model is already loaded under s.Cwd

Callers

nothing calls this directly

Calls 5

runProgramMethod · 0.95
PredFunction · 0.92
PredFunction · 0.92
GetModelKindMethod · 0.80

Tested by

no test coverage detected