-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added support for PowerShell #114
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fceb8fe
added support for Powershell
StrikerRUS c458e3b
simplified powershell call command
StrikerRUS 42c400e
avoid job time limit at Travis
StrikerRUS 8775171
fit in 50 min for sure
StrikerRUS 2a30f6a
fixed conflicts
StrikerRUS 9e02b2c
fixed conflicts
StrikerRUS 3b8600f
fixed pep8
StrikerRUS cd809df
fixed conflicts
StrikerRUS 85731a0
Merge branch 'master' into powershell
StrikerRUS cd2199f
Merge branch 'master' into powershell
StrikerRUS 14495ad
added functionality to overwrite comparison operators
StrikerRUS 88a9852
fixed conflicts
StrikerRUS f6b448b
new workaround for slow testing
StrikerRUS b20cd1c
Merge branch 'master' into powershell
StrikerRUS b91a1b2
Merge branch 'master' into powershell
StrikerRUS 056bd1c
Merge branch 'master' into powershell
izeigerman File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
21 changes: 21 additions & 0 deletions
21
generated_code_examples/powershell/classification/decision_tree.ps1
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,21 @@ | ||
function Score([double[]] $InputVector) { | ||
[double[]]$var0 = @(0) | ||
if (($InputVector[2]) -le (2.6)) { | ||
$var0 = @($(1.0), $(0.0), $(0.0)) | ||
} else { | ||
if (($InputVector[2]) -le (4.8500004)) { | ||
if (($InputVector[3]) -le (1.6500001)) { | ||
$var0 = @($(0.0), $(1.0), $(0.0)) | ||
} else { | ||
$var0 = @($(0.0), $(0.3333333333333333), $(0.6666666666666666)) | ||
} | ||
} else { | ||
if (($InputVector[3]) -le (1.75)) { | ||
$var0 = @($(0.0), $(0.42857142857142855), $(0.5714285714285714)) | ||
} else { | ||
$var0 = @($(0.0), $(0.0), $(1.0)) | ||
} | ||
} | ||
} | ||
return $var0 | ||
} |
79 changes: 79 additions & 0 deletions
79
generated_code_examples/powershell/classification/lightgbm.ps1
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,79 @@ | ||
function Score([double[]] $InputVector) { | ||
[double]$var0 = 0 | ||
if (($InputVector[2]) -gt (1.8)) { | ||
if (($InputVector[2]) -gt (4.250000000000001)) { | ||
$var0 = -1.1736122903444903 | ||
} else { | ||
$var0 = -1.1633850173886202 | ||
} | ||
} else { | ||
$var0 = -0.9486122853153485 | ||
} | ||
[double]$var1 = 0 | ||
if (($InputVector[2]) -gt (1.8)) { | ||
if (($InputVector[1]) -gt (3.0500000000000003)) { | ||
$var1 = -0.06193194743580539 | ||
} else { | ||
$var1 = -0.07237070828653688 | ||
} | ||
} else { | ||
$var1 = 0.12984943093573026 | ||
} | ||
[double]$var2 = 0 | ||
$var2 = [math]::Exp(((0) + ($var0)) + ($var1)) | ||
[double]$var3 = 0 | ||
if (($InputVector[2]) -gt (1.8)) { | ||
if (($InputVector[2]) -gt (4.8500000000000005)) { | ||
$var3 = -1.1807342692411888 | ||
} else { | ||
$var3 = -0.9831932134295853 | ||
} | ||
} else { | ||
$var3 = -1.1952609652674462 | ||
} | ||
[double]$var4 = 0 | ||
if (($InputVector[2]) -gt (1.8)) { | ||
if (($InputVector[2]) -gt (4.8500000000000005)) { | ||
$var4 = -0.05694282927518771 | ||
} else { | ||
$var4 = 0.11960489254350348 | ||
} | ||
} else { | ||
$var4 = -0.07151978915296087 | ||
} | ||
[double]$var5 = 0 | ||
$var5 = [math]::Exp(((0) + ($var3)) + ($var4)) | ||
[double]$var6 = 0 | ||
if (($InputVector[2]) -gt (4.8500000000000005)) { | ||
if (($InputVector[3]) -gt (1.9500000000000002)) { | ||
$var6 = -0.9298942558407184 | ||
} else { | ||
$var6 = -0.9632815288936335 | ||
} | ||
} else { | ||
if (($InputVector[2]) -gt (4.250000000000001)) { | ||
$var6 = -1.1322413652523249 | ||
} else { | ||
$var6 = -1.1524760761934856 | ||
} | ||
} | ||
[double]$var7 = 0 | ||
if (($InputVector[2]) -gt (4.8500000000000005)) { | ||
if (($InputVector[3]) -gt (1.9500000000000002)) { | ||
$var7 = 0.12809276954555665 | ||
} else { | ||
$var7 = 0.09898817876916756 | ||
} | ||
} else { | ||
if (($InputVector[2]) -gt (4.250000000000001)) { | ||
$var7 = -0.052710589717642864 | ||
} else { | ||
$var7 = -0.07292857712854424 | ||
} | ||
} | ||
[double]$var8 = 0 | ||
$var8 = [math]::Exp(((0) + ($var6)) + ($var7)) | ||
[double]$var9 = 0 | ||
$var9 = (($var2) + ($var5)) + ($var8) | ||
return @($(($var2) / ($var9)), $(($var5) / ($var9)), $(($var8) / ($var9))) | ||
} |
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,3 @@ | ||
function Score([double[]] $InputVector) { | ||
return @($(((((0.2614587435880605) + (($InputVector[0]) * (0.42474116053569605))) + (($InputVector[1]) * (1.3963906033045026))) + (($InputVector[2]) * (-2.215054318516674))) + (($InputVector[3]) * (-0.9587396176450289))), $(((((1.1348839223808307) + (($InputVector[0]) * (0.2567965976997648))) + (($InputVector[1]) * (-1.3904789369836008))) + (($InputVector[2]) * (0.596683023311173))) + (($InputVector[3]) * (-1.2690022726388828))), $(((((-1.2162802012560197) + (($InputVector[0]) * (-1.6357766989177105))) + (($InputVector[1]) * (-1.5040638728422817))) + (($InputVector[2]) * (2.427835933129272))) + (($InputVector[3]) * (2.3469310693367276)))) | ||
} |
55 changes: 55 additions & 0 deletions
55
generated_code_examples/powershell/classification/random_forest.ps1
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,55 @@ | ||
function Add-Vectors([double[]] $v1, [double[]] $v2) { | ||
[int] $length = $v1.Length | ||
[double[]] $result = @(0) * $length | ||
for ([int] $i = 0; $i -lt $length; ++$i) { | ||
$result[$i] = $v1[$i] + $v2[$i] | ||
} | ||
return $result | ||
} | ||
function Mul-Vector-Number([double[]] $v1, [double] $num) { | ||
[int] $length = $v1.Length | ||
[double[]] $result = @(0) * $length | ||
for ([int] $i = 0; $i -lt $length; ++$i) { | ||
$result[$i] = $v1[$i] * $num | ||
} | ||
return $result | ||
} | ||
function Score([double[]] $InputVector) { | ||
[double[]]$var0 = @(0) | ||
if (($InputVector[3]) -le (0.8)) { | ||
$var0 = @($(1.0), $(0.0), $(0.0)) | ||
} else { | ||
if (($InputVector[2]) -le (4.8500004)) { | ||
$var0 = @($(0.0), $(0.9795918367346939), $(0.02040816326530612)) | ||
} else { | ||
if (($InputVector[3]) -le (1.75)) { | ||
if (($InputVector[3]) -le (1.6500001)) { | ||
$var0 = @($(0.0), $(0.25), $(0.75)) | ||
} else { | ||
$var0 = @($(0.0), $(1.0), $(0.0)) | ||
} | ||
} else { | ||
$var0 = @($(0.0), $(0.0), $(1.0)) | ||
} | ||
} | ||
} | ||
[double[]]$var1 = @(0) | ||
if (($InputVector[3]) -le (0.8)) { | ||
$var1 = @($(1.0), $(0.0), $(0.0)) | ||
} else { | ||
if (($InputVector[0]) -le (6.05)) { | ||
if (($InputVector[2]) -le (4.9)) { | ||
$var1 = @($(0.0), $(0.9032258064516129), $(0.0967741935483871)) | ||
} else { | ||
$var1 = @($(0.0), $(0.0), $(1.0)) | ||
} | ||
} else { | ||
if (($InputVector[3]) -le (1.75)) { | ||
$var1 = @($(0.0), $(0.8), $(0.2)) | ||
} else { | ||
$var1 = @($(0.0), $(0.0), $(1.0)) | ||
} | ||
} | ||
} | ||
return Add-Vectors $(Mul-Vector-Number $($var0) $(0.5)) $(Mul-Vector-Number $($var1) $(0.5)) | ||
} |
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,69 @@ | ||
function Score([double[]] $InputVector) { | ||
[double]$var0 = 0 | ||
$var0 = (0) - (0.25) | ||
[double]$var1 = 0 | ||
$var1 = [math]::Exp(($var0) * (((([math]::Pow((5.4) - ($InputVector[0]), 2)) + ([math]::Pow((3.0) - ($InputVector[1]), 2))) + ([math]::Pow((4.5) - ($InputVector[2]), 2))) + ([math]::Pow((1.5) - ($InputVector[3]), 2)))) | ||
[double]$var2 = 0 | ||
$var2 = [math]::Exp(($var0) * (((([math]::Pow((6.2) - ($InputVector[0]), 2)) + ([math]::Pow((2.2) - ($InputVector[1]), 2))) + ([math]::Pow((4.5) - ($InputVector[2]), 2))) + ([math]::Pow((1.5) - ($InputVector[3]), 2)))) | ||
[double]$var3 = 0 | ||
$var3 = [math]::Exp(($var0) * (((([math]::Pow((5.0) - ($InputVector[0]), 2)) + ([math]::Pow((2.3) - ($InputVector[1]), 2))) + ([math]::Pow((3.3) - ($InputVector[2]), 2))) + ([math]::Pow((1.0) - ($InputVector[3]), 2)))) | ||
[double]$var4 = 0 | ||
$var4 = [math]::Exp(($var0) * (((([math]::Pow((5.9) - ($InputVector[0]), 2)) + ([math]::Pow((3.2) - ($InputVector[1]), 2))) + ([math]::Pow((4.8) - ($InputVector[2]), 2))) + ([math]::Pow((1.8) - ($InputVector[3]), 2)))) | ||
[double]$var5 = 0 | ||
$var5 = [math]::Exp(($var0) * (((([math]::Pow((5.0) - ($InputVector[0]), 2)) + ([math]::Pow((2.0) - ($InputVector[1]), 2))) + ([math]::Pow((3.5) - ($InputVector[2]), 2))) + ([math]::Pow((1.0) - ($InputVector[3]), 2)))) | ||
[double]$var6 = 0 | ||
$var6 = [math]::Exp(($var0) * (((([math]::Pow((6.7) - ($InputVector[0]), 2)) + ([math]::Pow((3.0) - ($InputVector[1]), 2))) + ([math]::Pow((5.0) - ($InputVector[2]), 2))) + ([math]::Pow((1.7) - ($InputVector[3]), 2)))) | ||
[double]$var7 = 0 | ||
$var7 = [math]::Exp(($var0) * (((([math]::Pow((7.0) - ($InputVector[0]), 2)) + ([math]::Pow((3.2) - ($InputVector[1]), 2))) + ([math]::Pow((4.7) - ($InputVector[2]), 2))) + ([math]::Pow((1.4) - ($InputVector[3]), 2)))) | ||
[double]$var8 = 0 | ||
$var8 = [math]::Exp(($var0) * (((([math]::Pow((4.9) - ($InputVector[0]), 2)) + ([math]::Pow((2.4) - ($InputVector[1]), 2))) + ([math]::Pow((3.3) - ($InputVector[2]), 2))) + ([math]::Pow((1.0) - ($InputVector[3]), 2)))) | ||
[double]$var9 = 0 | ||
$var9 = [math]::Exp(($var0) * (((([math]::Pow((6.3) - ($InputVector[0]), 2)) + ([math]::Pow((2.5) - ($InputVector[1]), 2))) + ([math]::Pow((4.9) - ($InputVector[2]), 2))) + ([math]::Pow((1.5) - ($InputVector[3]), 2)))) | ||
[double]$var10 = 0 | ||
$var10 = [math]::Exp(($var0) * (((([math]::Pow((6.0) - ($InputVector[0]), 2)) + ([math]::Pow((2.7) - ($InputVector[1]), 2))) + ([math]::Pow((5.1) - ($InputVector[2]), 2))) + ([math]::Pow((1.6) - ($InputVector[3]), 2)))) | ||
[double]$var11 = 0 | ||
$var11 = [math]::Exp(($var0) * (((([math]::Pow((5.7) - ($InputVector[0]), 2)) + ([math]::Pow((2.6) - ($InputVector[1]), 2))) + ([math]::Pow((3.5) - ($InputVector[2]), 2))) + ([math]::Pow((1.0) - ($InputVector[3]), 2)))) | ||
[double]$var12 = 0 | ||
$var12 = [math]::Exp(($var0) * (((([math]::Pow((5.1) - ($InputVector[0]), 2)) + ([math]::Pow((3.8) - ($InputVector[1]), 2))) + ([math]::Pow((1.9) - ($InputVector[2]), 2))) + ([math]::Pow((0.4) - ($InputVector[3]), 2)))) | ||
[double]$var13 = 0 | ||
$var13 = [math]::Exp(($var0) * (((([math]::Pow((4.4) - ($InputVector[0]), 2)) + ([math]::Pow((2.9) - ($InputVector[1]), 2))) + ([math]::Pow((1.4) - ($InputVector[2]), 2))) + ([math]::Pow((0.2) - ($InputVector[3]), 2)))) | ||
[double]$var14 = 0 | ||
$var14 = [math]::Exp(($var0) * (((([math]::Pow((5.7) - ($InputVector[0]), 2)) + ([math]::Pow((4.4) - ($InputVector[1]), 2))) + ([math]::Pow((1.5) - ($InputVector[2]), 2))) + ([math]::Pow((0.4) - ($InputVector[3]), 2)))) | ||
[double]$var15 = 0 | ||
$var15 = [math]::Exp(($var0) * (((([math]::Pow((5.8) - ($InputVector[0]), 2)) + ([math]::Pow((4.0) - ($InputVector[1]), 2))) + ([math]::Pow((1.2) - ($InputVector[2]), 2))) + ([math]::Pow((0.2) - ($InputVector[3]), 2)))) | ||
[double]$var16 = 0 | ||
$var16 = [math]::Exp(($var0) * (((([math]::Pow((5.1) - ($InputVector[0]), 2)) + ([math]::Pow((3.3) - ($InputVector[1]), 2))) + ([math]::Pow((1.7) - ($InputVector[2]), 2))) + ([math]::Pow((0.5) - ($InputVector[3]), 2)))) | ||
[double]$var17 = 0 | ||
$var17 = [math]::Exp(($var0) * (((([math]::Pow((5.7) - ($InputVector[0]), 2)) + ([math]::Pow((3.8) - ($InputVector[1]), 2))) + ([math]::Pow((1.7) - ($InputVector[2]), 2))) + ([math]::Pow((0.3) - ($InputVector[3]), 2)))) | ||
[double]$var18 = 0 | ||
$var18 = [math]::Exp(($var0) * (((([math]::Pow((4.3) - ($InputVector[0]), 2)) + ([math]::Pow((3.0) - ($InputVector[1]), 2))) + ([math]::Pow((1.1) - ($InputVector[2]), 2))) + ([math]::Pow((0.1) - ($InputVector[3]), 2)))) | ||
[double]$var19 = 0 | ||
$var19 = [math]::Exp(($var0) * (((([math]::Pow((4.5) - ($InputVector[0]), 2)) + ([math]::Pow((2.3) - ($InputVector[1]), 2))) + ([math]::Pow((1.3) - ($InputVector[2]), 2))) + ([math]::Pow((0.3) - ($InputVector[3]), 2)))) | ||
[double]$var20 = 0 | ||
$var20 = [math]::Exp(($var0) * (((([math]::Pow((6.3) - ($InputVector[0]), 2)) + ([math]::Pow((2.7) - ($InputVector[1]), 2))) + ([math]::Pow((4.9) - ($InputVector[2]), 2))) + ([math]::Pow((1.8) - ($InputVector[3]), 2)))) | ||
[double]$var21 = 0 | ||
$var21 = [math]::Exp(($var0) * (((([math]::Pow((6.0) - ($InputVector[0]), 2)) + ([math]::Pow((3.0) - ($InputVector[1]), 2))) + ([math]::Pow((4.8) - ($InputVector[2]), 2))) + ([math]::Pow((1.8) - ($InputVector[3]), 2)))) | ||
[double]$var22 = 0 | ||
$var22 = [math]::Exp(($var0) * (((([math]::Pow((6.3) - ($InputVector[0]), 2)) + ([math]::Pow((2.8) - ($InputVector[1]), 2))) + ([math]::Pow((5.1) - ($InputVector[2]), 2))) + ([math]::Pow((1.5) - ($InputVector[3]), 2)))) | ||
[double]$var23 = 0 | ||
$var23 = [math]::Exp(($var0) * (((([math]::Pow((5.8) - ($InputVector[0]), 2)) + ([math]::Pow((2.8) - ($InputVector[1]), 2))) + ([math]::Pow((5.1) - ($InputVector[2]), 2))) + ([math]::Pow((2.4) - ($InputVector[3]), 2)))) | ||
[double]$var24 = 0 | ||
$var24 = [math]::Exp(($var0) * (((([math]::Pow((6.1) - ($InputVector[0]), 2)) + ([math]::Pow((3.0) - ($InputVector[1]), 2))) + ([math]::Pow((4.9) - ($InputVector[2]), 2))) + ([math]::Pow((1.8) - ($InputVector[3]), 2)))) | ||
[double]$var25 = 0 | ||
$var25 = [math]::Exp(($var0) * (((([math]::Pow((7.7) - ($InputVector[0]), 2)) + ([math]::Pow((2.6) - ($InputVector[1]), 2))) + ([math]::Pow((6.9) - ($InputVector[2]), 2))) + ([math]::Pow((2.3) - ($InputVector[3]), 2)))) | ||
[double]$var26 = 0 | ||
$var26 = [math]::Exp(($var0) * (((([math]::Pow((6.9) - ($InputVector[0]), 2)) + ([math]::Pow((3.1) - ($InputVector[1]), 2))) + ([math]::Pow((5.1) - ($InputVector[2]), 2))) + ([math]::Pow((2.3) - ($InputVector[3]), 2)))) | ||
[double]$var27 = 0 | ||
$var27 = [math]::Exp(($var0) * (((([math]::Pow((6.3) - ($InputVector[0]), 2)) + ([math]::Pow((3.3) - ($InputVector[1]), 2))) + ([math]::Pow((6.0) - ($InputVector[2]), 2))) + ([math]::Pow((2.5) - ($InputVector[3]), 2)))) | ||
[double]$var28 = 0 | ||
$var28 = [math]::Exp(($var0) * (((([math]::Pow((4.9) - ($InputVector[0]), 2)) + ([math]::Pow((2.5) - ($InputVector[1]), 2))) + ([math]::Pow((4.5) - ($InputVector[2]), 2))) + ([math]::Pow((1.7) - ($InputVector[3]), 2)))) | ||
[double]$var29 = 0 | ||
$var29 = [math]::Exp(($var0) * (((([math]::Pow((6.0) - ($InputVector[0]), 2)) + ([math]::Pow((2.2) - ($InputVector[1]), 2))) + ([math]::Pow((5.0) - ($InputVector[2]), 2))) + ([math]::Pow((1.5) - ($InputVector[3]), 2)))) | ||
[double]$var30 = 0 | ||
$var30 = [math]::Exp(($var0) * (((([math]::Pow((7.9) - ($InputVector[0]), 2)) + ([math]::Pow((3.8) - ($InputVector[1]), 2))) + ([math]::Pow((6.4) - ($InputVector[2]), 2))) + ([math]::Pow((2.0) - ($InputVector[3]), 2)))) | ||
[double]$var31 = 0 | ||
$var31 = [math]::Exp(($var0) * (((([math]::Pow((7.2) - ($InputVector[0]), 2)) + ([math]::Pow((3.0) - ($InputVector[1]), 2))) + ([math]::Pow((5.8) - ($InputVector[2]), 2))) + ([math]::Pow((1.6) - ($InputVector[3]), 2)))) | ||
[double]$var32 = 0 | ||
$var32 = [math]::Exp(($var0) * (((([math]::Pow((7.7) - ($InputVector[0]), 2)) + ([math]::Pow((3.8) - ($InputVector[1]), 2))) + ([math]::Pow((6.7) - ($InputVector[2]), 2))) + ([math]::Pow((2.2) - ($InputVector[3]), 2)))) | ||
return @($((((((((((((((((((((-0.08359187780790468) + (($var1) * (-0.0))) + (($var2) * (-0.0))) + (($var3) * (-0.4393498355605194))) + (($var4) * (-0.009465620856664334))) + (($var5) * (-0.16223369966927))) + (($var6) * (-0.26861888775075243))) + (($var7) * (-0.4393498355605194))) + (($var8) * (-0.4393498355605194))) + (($var9) * (-0.0))) + (($var10) * (-0.0))) + (($var11) * (-0.19673905328606292))) + (($var12) * (0.3340655283922188))) + (($var13) * (0.3435087305152051))) + (($var14) * (0.4393498355605194))) + (($var15) * (0.0))) + (($var16) * (0.28614124535416424))) + (($var17) * (0.11269159286168087))) + (($var18) * (0.0))) + (($var19) * (0.4393498355605194))), $((((((((((((((((((((((-0.18563912331454907) + (($var20) * (-0.0))) + (($var21) * (-0.06014273244194299))) + (($var22) * (-0.0))) + (($var23) * (-0.031132453078851926))) + (($var24) * (-0.0))) + (($var25) * (-0.3893079321588921))) + (($var26) * (-0.06738007627290196))) + (($var27) * (-0.1225075748937126))) + (($var28) * (-0.3893079321588921))) + (($var29) * (-0.29402231709614085))) + (($var30) * (-0.3893079321588921))) + (($var31) * (-0.0))) + (($var32) * (-0.028242141062729226))) + (($var12) * (0.16634667752431267))) + (($var13) * (0.047772685163074764))) + (($var14) * (0.3893079321588921))) + (($var15) * (0.3893079321588921))) + (($var16) * (0.0))) + (($var17) * (0.0))) + (($var18) * (0.3893079321588921))) + (($var19) * (0.3893079321588921))), $(((((((((((((((((((((((((0.5566649875797668) + (($var20) * (-25.563066587228416))) + (($var21) * (-38.35628154976547))) + (($var22) * (-38.35628154976547))) + (($var23) * (-0.0))) + (($var24) * (-38.35628154976547))) + (($var25) * (-0.0))) + (($var26) * (-0.0))) + (($var27) * (-0.0))) + (($var28) * (-6.2260303727828745))) + (($var29) * (-18.42781911624364))) + (($var30) * (-0.14775026537286423))) + (($var31) * (-7.169755983020096))) + (($var32) * (-0.0))) + (($var1) * (12.612328267927264))) + (($var2) * (6.565812506955159))) + (($var3) * (0.0))) + (($var4) * (38.35628154976547))) + (($var5) * (0.0))) + (($var6) * (38.35628154976547))) + (($var7) * (0.0))) + (($var8) * (0.0))) + (($var9) * (38.35628154976547))) + (($var10) * (38.35628154976547))) + (($var11) * (0.0)))) | ||
} |
71 changes: 71 additions & 0 deletions
71
generated_code_examples/powershell/classification/xgboost.ps1
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,71 @@ | ||
function Score([double[]] $InputVector) { | ||
[double]$var0 = 0 | ||
if (($InputVector[2]) -ge (2.5999999)) { | ||
$var0 = -0.0731707439 | ||
} else { | ||
$var0 = 0.142857149 | ||
} | ||
[double]$var1 = 0 | ||
if (($InputVector[2]) -ge (2.5999999)) { | ||
$var1 = -0.0705206916 | ||
} else { | ||
$var1 = 0.12477719 | ||
} | ||
[double]$var2 = 0 | ||
$var2 = [math]::Exp(((0.5) + ($var0)) + ($var1)) | ||
[double]$var3 = 0 | ||
if (($InputVector[2]) -ge (2.5999999)) { | ||
if (($InputVector[2]) -ge (4.85000038)) { | ||
$var3 = -0.0578680299 | ||
} else { | ||
$var3 = 0.132596686 | ||
} | ||
} else { | ||
$var3 = -0.0714285821 | ||
} | ||
[double]$var4 = 0 | ||
if (($InputVector[2]) -ge (2.5999999)) { | ||
if (($InputVector[2]) -ge (4.85000038)) { | ||
$var4 = -0.0552999265 | ||
} else { | ||
$var4 = 0.116139404 | ||
} | ||
} else { | ||
$var4 = -0.0687687024 | ||
} | ||
[double]$var5 = 0 | ||
$var5 = [math]::Exp(((0.5) + ($var3)) + ($var4)) | ||
[double]$var6 = 0 | ||
if (($InputVector[2]) -ge (4.85000038)) { | ||
if (($InputVector[3]) -ge (1.75)) { | ||
$var6 = 0.142011836 | ||
} else { | ||
$var6 = 0.0405405387 | ||
} | ||
} else { | ||
if (($InputVector[3]) -ge (1.6500001)) { | ||
$var6 = 0.0428571403 | ||
} else { | ||
$var6 = -0.0730659068 | ||
} | ||
} | ||
[double]$var7 = 0 | ||
if (($InputVector[2]) -ge (4.85000038)) { | ||
if (($InputVector[3]) -ge (1.75)) { | ||
$var7 = 0.124653697 | ||
} else { | ||
$var7 = 0.035562478 | ||
} | ||
} else { | ||
if (($InputVector[3]) -ge (1.6500001)) { | ||
$var7 = 0.0425687581 | ||
} else { | ||
$var7 = -0.0704230517 | ||
} | ||
} | ||
[double]$var8 = 0 | ||
$var8 = [math]::Exp(((0.5) + ($var6)) + ($var7)) | ||
[double]$var9 = 0 | ||
$var9 = (($var2) + ($var5)) + ($var8) | ||
return @($(($var2) / ($var9)), $(($var5) / ($var9)), $(($var8) / ($var9))) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
MODEL_TYPE
instead ofTASK
? "Task" seems a bit vague.