-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.py
97 lines (81 loc) · 1.91 KB
/
examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
from openValGenerator import openValGenerator
column = "pickup_latitude"
table = "rides"
db = "gda_taxi"
y = openValGenerator(db, table, column)
print(f"Do {column}")
print(y.istrained())
if not y.istrained():
y.train()
print(y.column_type)
print(y.istrained())
# Get values in a given range
print(y.getVal(40.75, 40.755))
print(y.getVal(-73.955, -73.950))
print("-------------------------------")
column = "firstname"
table = "accounts"
db = 'gda_banking'
x = openValGenerator(db, table, column)
print(f"Do {column}")
print(x.istrained())
if not x.istrained():
x.train()
print(x.column_type)
print(x.istrained())
# Get any text value
for _ in range(10):
print(x.getVal())
print("-------------------------------")
column = "frequency"
table = "accounts"
db = 'gda_banking'
x = openValGenerator(db, table, column)
print(f"Do {column}")
print(x.istrained())
if not x.istrained():
x.train()
print(x.column_type)
print(x.istrained())
for _ in range(10):
print(x.getVal())
print("-------------------------------")
column = "email"
table = "accounts"
db = 'gda_banking'
x = openValGenerator(db, table, column)
print(f"Do {column}")
print(x.istrained())
if not x.istrained():
x.train()
print(x.column_type)
print(x.istrained())
print(x.is_email())
for _ in range(10):
print(x.getVal())
print("-------------------------------")
column = "trip_distance"
table = "rides"
db = "gda_taxi"
y = openValGenerator(db, table, column)
print(f"Do {column}")
print(y.istrained())
if not y.istrained():
y.train()
print(y.column_type)
print(y.istrained())
print(y.getVal(1, 5))
print(y.getVal(1, 5))
print("-------------------------------")
column = "pickup_longitude"
table = "rides"
db = "gda_taxi"
y = openValGenerator(db, table, column)
print(f"Do {column}")
print(y.istrained())
if not y.istrained():
y.train()
print(y.column_type)
print(y.istrained())
print(y.getVal(-73.96, -73.95))
print(y.getVal(-73.955, -73.950))