Skip to content

Commit 33298b3

Browse files
committed
Modifying for Python 2 and 3 compatibility
1 parent 90689ac commit 33298b3

File tree

9 files changed

+104
-10
lines changed

9 files changed

+104
-10
lines changed

analytics/demo-RTM-loco/demo-RTM-loco-py/config.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"entry-method": "rtm.LocomotiveRegression.driver",
33
"conda-libs": [
44
"numpy",
5-
"scikit-learn",
6-
"scipy",
7-
"pandas"
5+
"scikit-learn==0.20",
6+
"scipy==1.2.2",
7+
"pandas==0.24.2"
88
]
99
}

analytics/demo-RTM-loco/demo-RTM-loco-py/rtm/RTMLocomotiveRegression.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class LocomotiveRegression:
88
def __init__(self):
9-
print "Locomotive Linear Regression"
9+
print("Locomotive Linear Regression")
1010

1111
def driver(self, data):
1212
data_json = json.loads(data)
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from RTMLocomotiveRegression import LocomotiveRegression
1+
from rtm.RTMLocomotiveRegression import LocomotiveRegression
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"test": {
3+
"wind_speed": [
4+
8,
5+
15,
6+
11,
7+
6,
8+
24,
9+
3,
10+
21,
11+
14,
12+
25,
13+
11
14+
],
15+
"RTM": [
16+
369.11,
17+
365.95,
18+
365.87,
19+
371.31,
20+
365.69,
21+
362.92,
22+
364.29,
23+
367.22,
24+
363.9,
25+
357.35
26+
],
27+
"loco_speed": [
28+
44.1,
29+
42.8,
30+
40.06,
31+
46.08,
32+
47.23,
33+
35.7,
34+
51.36,
35+
41.4,
36+
44.65,
37+
33.09
38+
]
39+
},
40+
"train": {
41+
"wind_speed": [
42+
17,
43+
17,
44+
22,
45+
19,
46+
11,
47+
19,
48+
10,
49+
17,
50+
28,
51+
14
52+
],
53+
"RTM": [
54+
360.84,
55+
363.66,
56+
364.56,
57+
363.84,
58+
363.14,
59+
360.46,
60+
365.07,
61+
366.93,
62+
360.67,
63+
361.6
64+
],
65+
"loco_speed": [
66+
38.28,
67+
41.31,
68+
44.52,
69+
40.93,
70+
38.4,
71+
38.34,
72+
38.63,
73+
45.11,
74+
46.43,
75+
37.46
76+
]
77+
}
78+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"R2": [
3+
0.69188
4+
],
5+
"Prediction": [
6+
370.0659,
7+
366.4111,
8+
365.6598,
9+
371.8394,
10+
365.0185,
11+
363.5657,
12+
366.5063,
13+
365.7035,
14+
363.5706,
15+
356.2802
16+
]
17+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from demoAdder import demoAdder
1+
from analytic.demoAdder import demoAdder

analytics/demo-adder/demo-adder-py/analytic/demoAdder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class demoAdder:
55
def __init__(self):
6-
print "Create pyadder"
6+
print("Create pyadder")
77

88
def add(self, data):
99
data_json = json.loads(data)

analytics/demo-adder/demo-adder-py/config.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"boto"
55
],
66
"conda-libs": [
7-
"numpy",
8-
"scipy"
7+
"numpy"
98
]
109
}

analytics/demo-timeseries-adder-with-model/demo-timeseries-adder-with-model-py/analytics/demoTimeSeriesAdder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class demoTimeSeriesAdder:
44
def __init__(self):
5-
print "Create python time series demo adder"
5+
print("Create python time series demo adder")
66

77
def add2NumberArrays(self, data, modelmap = {}):
88
threshold = float(modelmap['threshold']) if len(modelmap) > 0 else None

0 commit comments

Comments
 (0)