-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1794 from chncaesar/issue1649
Add pathPrefix for modelExplain
- Loading branch information
Showing
4 changed files
with
87 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
streamingpro-it/src/test/resources/sql/simple/23_random_forest_model_explain.mlsql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--%comparator=tech.mlsql.it.IgnoreResultComparator | ||
|
||
set jsonStr=''' | ||
{"features":[5.1,3.5,1.4,0.2],"label":0.0}, | ||
{"features":[5.1,3.5,1.4,0.2],"label":1.0} | ||
{"features":[5.1,3.5,1.4,0.2],"label":0.0} | ||
{"features":[4.4,2.9,1.4,0.2],"label":0.0} | ||
{"features":[5.1,3.5,1.4,0.2],"label":1.0} | ||
{"features":[5.1,3.5,1.4,0.2],"label":0.0} | ||
{"features":[5.1,3.5,1.4,0.2],"label":0.0} | ||
{"features":[4.7,3.2,1.3,0.2],"label":1.0} | ||
{"features":[5.1,3.5,1.4,0.2],"label":0.0} | ||
{"features":[5.1,3.5,1.4,0.2],"label":0.0} | ||
'''; | ||
load jsonStr.`jsonStr` as mock_data; | ||
|
||
|
||
select vec_dense(features) as features, label as label from mock_data as mock_data_1; | ||
|
||
|
||
train mock_data_1 as RandomForest.`/tmp/model` where | ||
keepVersion="true" | ||
and evaluateTable="mock_data_validate" | ||
|
||
and `fitParam.0.labelCol`="label" | ||
and `fitParam.0.featuresCol`="features" | ||
and `fitParam.0.maxDepth`="2" | ||
|
||
and `fitParam.1.featuresCol`="features" | ||
and `fitParam.1.labelCol`="label" | ||
and `fitParam.1.maxDepth`="10" | ||
; | ||
|
||
load modelExplain.`/tmp/model/_model_0/` where alg="RandomForest" as output_1; | ||
|
||
select `name` from output_1 where name="uid" as result; | ||
|
||
!assert result ''':name=="uid"''' "RandomForest modelExplain should be successful"; | ||
|
||
|
||
load modelExplain.`/tmp/model/_model_0/` where alg="RandomForest" and index = "0" as output_2; | ||
select `name` from output_2 where name="uid" as result_2; | ||
!assert result_2 ''':name=="uid"''' "RandomForest modelExplain should be successful"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters