Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghislain Fourny committed Feb 27, 2024
1 parent c52ff1f commit 4aef769
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/test/resources/test_files/RumbleML/RumbleML/MLPipeline3.jq
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
(:JIQS: ShouldRun; Output="({ "id" : 0, "label" : 1, "col1" : -1, "col2" : 1.5, "col3" : 1.3, "features" : [ -1, 1.5, 1.3 ], "features2" : [ 0.6811443247067492, -1.6574062675838126 ], "rawPrediction" : [ -37.806767087840996, 37.806767087840996 ], "probability" : [ 3.808287043115909E-17, 1 ], "ocol1" : 1 }, { "id" : 1, "label" : 0, "col1" : 3, "col2" : 2, "col3" : -0.1, "features" : [ 3, 2, -0.1 ], "features2" : [ -2.93898570550277, 0.48441694826197534 ], "rawPrediction" : [ 37.56770709258572, -37.56770709258572 ], "probability" : [ 1, 0 ], "ocol1" : 0 }, { "id" : 2, "label" : 1, "col1" : 0, "col2" : 2.2, "col3" : -1.5, "features" : [ 0, 2.2, -1.5 ], "features2" : [ 0.28609394877170796, 1.1822492465709793 ], "rawPrediction" : [ -19.16835344100661, 19.16835344100661 ], "probability" : [ 4.734671708106428E-9, 0.9999999952653283 ], "ocol1" : 1 })" :)
(:JIQS: ShouldRun; Output="({ "id" : 0, "label" : 1, "col1" : -1, "col2" : 1.5, "col3" : 1.3, "features" : [ -1, 1.5, 1.3 ], "ocol1" : 1, "features2" : [ 0.6811443, -1.6574062 ], "rawPrediction" : [ -37.806767, 37.806767 ], "probability" : [ 3.808287E-17, 1 ] }, { "id" : 1, "label" : 0, "col1" : 3, "col2" : 2, "col3" : -0.1, "features" : [ 3, 2, -0.1 ], "ocol1" : 0, "features2" : [ -2.9389858, 0.48441696 ], "rawPrediction" : [ 37.567707, -37.567707 ], "probability" : [ 1, 0 ] }, { "id" : 2, "label" : 1, "col1" : 0, "col2" : 2.2, "col3" : -1.5, "features" : [ 0, 2.2, -1.5 ], "ocol1" : 1, "features2" : [ 0.28609395, 1.1822492 ], "rawPrediction" : [ -19.168354, 19.168354 ], "probability" : [ 4.7346718E-9, 1 ] })" :)

declare function local:round($i as object) as object {
{|
remove-keys($i, ("features2", "rawPrediction", "probability")),
{
"features2" : [ for $v in $i.features2[] return float($v) ],
"rawPrediction" : [ for $v in $i.rawPrediction[] return float($v) ],
"probability" : [ for $v in $i.probability[] return float($v) ]
}
|}
};


declare type local:mytype as {
"id": "integer", "label": "integer", "col1": "decimal", "col2": "decimal", "col3": "decimal"
Expand Down Expand Up @@ -33,4 +45,4 @@ for $i in $trained_est2(
$my-new-test-data,
{"featuresCol": "features2", "predictionCol": "ocol1"}
)
return $i
return local:round($i)

0 comments on commit 4aef769

Please sign in to comment.