MCPcopy Index your code
hub / github.com/sql-machine-learning/sqlflow / TestRunSQLProgram

Function TestRunSQLProgram

go/sql/executor_ir_test.go:120–145  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

118)
119
120func TestRunSQLProgram(t *testing.T) {
121 a := assert.New(t)
122 modelDir := ""
123 a.NotPanics(func() {
124 stream := RunSQLProgram(`
125SELECT sepal_length as sl, sepal_width as sw, class FROM iris.train
126TO TRAIN xgboost.gbtree
127WITH
128 objective="multi:softprob",
129 train.num_boost_round = 30,
130 eta = 0.4,
131 num_class = 3
132LABEL class
133INTO sqlflow_models.my_xgboost_model_by_program;
134
135SELECT sepal_length as sl, sepal_width as sw FROM iris.test
136TO PREDICT iris.predict.class
137USING sqlflow_models.my_xgboost_model_by_program;
138
139SELECT sepal_length as sl, sepal_width as sw, class FROM iris.train
140TO EXPLAIN sqlflow_models.my_xgboost_model_by_program
141USING TreeExplainer;
142`, modelDir, database.GetSessionFromTestingDB())
143 a.True(test.GoodStream(stream.ReadAll()))
144 })
145}
146
147func TestExecuteXGBoostClassifier(t *testing.T) {
148 a := assert.New(t)

Callers

nothing calls this directly

Calls 4

GetSessionFromTestingDBFunction · 0.92
GoodStreamFunction · 0.92
RunSQLProgramFunction · 0.85
ReadAllMethod · 0.80

Tested by

no test coverage detected