-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue_103
- Loading branch information
Showing
13 changed files
with
131 additions
and
99 deletions.
There are no files selected for viewing
11 changes: 5 additions & 6 deletions
11
generated_code_examples/python/classification/decision_tree.py
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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import numpy as np | ||
def score(input): | ||
if (input[2]) <= (2.6): | ||
var0 = np.asarray([1.0, 0.0, 0.0]) | ||
var0 = [1.0, 0.0, 0.0] | ||
else: | ||
if (input[2]) <= (4.8500004): | ||
if (input[3]) <= (1.6500001): | ||
var0 = np.asarray([0.0, 1.0, 0.0]) | ||
var0 = [0.0, 1.0, 0.0] | ||
else: | ||
var0 = np.asarray([0.0, 0.3333333333333333, 0.6666666666666666]) | ||
var0 = [0.0, 0.3333333333333333, 0.6666666666666666] | ||
else: | ||
if (input[3]) <= (1.75): | ||
var0 = np.asarray([0.0, 0.42857142857142855, 0.5714285714285714]) | ||
var0 = [0.0, 0.42857142857142855, 0.5714285714285714] | ||
else: | ||
var0 = np.asarray([0.0, 0.0, 1.0]) | ||
var0 = [0.0, 0.0, 1.0] | ||
return var0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import numpy as np | ||
def score(input): | ||
return np.asarray([((((0.26145874358806076) + ((input[0]) * (0.4247411605356963))) + ((input[1]) * (1.3963906033045022))) + ((input[2]) * (-2.215054318516674))) + ((input[3]) * (-0.9587396176450291)), ((((1.1348839223808753) + ((input[0]) * (0.25679659769994584))) + ((input[1]) * (-1.3904789369835584))) + ((input[2]) * (0.5966830233112762))) + ((input[3]) * (-1.269002272638834)), ((((-1.216280201256021) + ((input[0]) * (-1.635776698917701))) + ((input[1]) * (-1.504063872842283))) + ((input[2]) * (2.4278359331292623))) + ((input[3]) * (2.346931069336734))]) | ||
return [((((0.2614587435880605) + ((input[0]) * (0.42474116053569605))) + ((input[1]) * (1.3963906033045026))) + ((input[2]) * (-2.215054318516674))) + ((input[3]) * (-0.9587396176450289)), ((((1.1348839223808307) + ((input[0]) * (0.2567965976997648))) + ((input[1]) * (-1.3904789369836008))) + ((input[2]) * (0.596683023311173))) + ((input[3]) * (-1.2690022726388828)), ((((-1.2162802012560197) + ((input[0]) * (-1.6357766989177105))) + ((input[1]) * (-1.5040638728422817))) + ((input[2]) * (2.427835933129272))) + ((input[3]) * (2.3469310693367276))] |
22 changes: 11 additions & 11 deletions
22
generated_code_examples/python/classification/random_forest.py
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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import numpy as np | ||
def score(input): | ||
if (input[3]) <= (0.8): | ||
var0 = np.asarray([1.0, 0.0, 0.0]) | ||
var0 = [1.0, 0.0, 0.0] | ||
else: | ||
if (input[2]) <= (4.8500004): | ||
var0 = np.asarray([0.0, 0.9795918367346939, 0.02040816326530612]) | ||
var0 = [0.0, 0.9795918367346939, 0.02040816326530612] | ||
else: | ||
if (input[3]) <= (1.75): | ||
if (input[3]) <= (1.6500001): | ||
var0 = np.asarray([0.0, 0.25, 0.75]) | ||
var0 = [0.0, 0.25, 0.75] | ||
else: | ||
var0 = np.asarray([0.0, 1.0, 0.0]) | ||
var0 = [0.0, 1.0, 0.0] | ||
else: | ||
var0 = np.asarray([0.0, 0.0, 1.0]) | ||
var0 = [0.0, 0.0, 1.0] | ||
if (input[3]) <= (0.8): | ||
var1 = np.asarray([1.0, 0.0, 0.0]) | ||
var1 = [1.0, 0.0, 0.0] | ||
else: | ||
if (input[0]) <= (6.05): | ||
if (input[2]) <= (4.9): | ||
var1 = np.asarray([0.0, 0.9032258064516129, 0.0967741935483871]) | ||
var1 = [0.0, 0.9032258064516129, 0.0967741935483871] | ||
else: | ||
var1 = np.asarray([0.0, 0.0, 1.0]) | ||
var1 = [0.0, 0.0, 1.0] | ||
else: | ||
if (input[3]) <= (1.75): | ||
var1 = np.asarray([0.0, 0.8, 0.2]) | ||
var1 = [0.0, 0.8, 0.2] | ||
else: | ||
var1 = np.asarray([0.0, 0.0, 1.0]) | ||
return ((var0) * (0.5)) + ((var1) * (0.5)) | ||
var1 = [0.0, 0.0, 1.0] | ||
return (np.asarray((np.asarray(var0)) * (0.5))) + (np.asarray((np.asarray(var1)) * (0.5))) |
Oops, something went wrong.