-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (30 loc) · 1.26 KB
/
Copy pathmain.py
File metadata and controls
40 lines (30 loc) · 1.26 KB
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
#!/usr/bin/python3
from classifier import *
from data_preprocessor import *
from plotters import *
import scipy as sp
pd.set_option('display.width', 1000)
# Preprocess the data so that we can use it
def process_data(nrows=None, outpufFileName = "result.csv"):
df = read_data("/Users/yaseralkayale/Documents/classes/current/csci6516 Big Data/Project/geolife_raw.csv", nrows)
print("Done reading in.")
result = computeData(df)
print("Done the computations")
result.to_csv(outpufFileName)
print("Done saving result file.")
# Plot the datapoints
def plot_graph(filename):
df = pd.read_csv(filename, usecols=range(1, 22))
p = Plotter(df)
p.plotHistogramPerClassAndFeature()
p.show()
def runTTest(df, algo):
validator = Validator(df)
statistic, p_val = sp.stats.ttest_ind(validator.cross_validate_flat(k=10, algo=algo),
validator.cross_validate_heirarchal(k=10, algo=algo),
equal_var=True)
print("Statistic = ", statistic," p-val= ", p_val)
# plot_graph("result2.csv")
# run_everything(nrows = None, outpufFileName="result2.csv")
df = pd.read_csv("/Users/yaseralkayale/Documents/classes/current/csci6516 Big Data/Project/result2.csv", usecols=range(1, 22))
runTTest(df, None)