Esempio n. 1
0
    def csv_plot_BMI(self):

        csvReader = reader()

        y = []
        x = []
        days = []

        next(csvReader)
        for row in csvReader:
            x.append(float(row[1]))
            y.append(
                datetime.datetime.strptime(row[8], '%Y-%M-%d').toordinal())
            days.append(row[8])

        return self.plot_func_BMI(x, y, days, 'Day', 'BMI', 'linear', 'BMI')
Esempio n. 2
0
    def csv_plot_blood_pressure(self):

        csvReader = reader()

        y = []
        x = []
        days = []

        next(csvReader)
        for row in csvReader:
            x.append(float(row[0]))
            y.append(
                datetime.datetime.strptime(row[8], '%Y-%M-%d').toordinal())
            days.append(row[8])

        return self.plot_func_blood_pressure(x, y, days, 'Day', 'Pressure',
                                             'linear', 'Blood pressure')
Esempio n. 3
0
    def csv_plot_exercise_length(self):

        csvReader = reader()

        y = []
        x = []
        days = []

        next(csvReader)
        for row in csvReader:
            x.append(float(row[5]))
            y.append(
                datetime.datetime.strptime(row[8], '%Y-%M-%d').toordinal())
            days.append(row[8])

        return self.plot_func_exercise_length(x, y, days, 'Day', 'Duration',
                                              'linear', 'Exercise Duration')
Esempio n. 4
0
    def csv_plot_Distance(self):

        csvReader = reader()

        y = []
        x = []
        days = []

        next(csvReader)
        for row in csvReader:
            x.append(float(row[6]))
            y.append(
                datetime.datetime.strptime(row[8], '%Y-%M-%d').toordinal())
            days.append(row[8])

        return self.plot_func_distance(x, y, days, 'Day', 'Distance Ran',
                                       'linear', 'Distance ran over the week')
Esempio n. 5
0
    def csv_plot_cigarettes(self):

        csvReader = reader()

        y = []
        x = []
        days = []

        next(csvReader)
        for row in csvReader:
            x.append(float(row[7]))
            y.append(
                datetime.datetime.strptime(row[8], '%Y-%M-%d').toordinal())
            days.append(row[8])

        return self.plot_func_cigarettes(x, y, days, 'Day',
                                         'Cigarettes on average', 'linear',
                                         'Cigarettes smoked')
Esempio n. 6
0
# import scv

# import knn.descent

# import viz

# data = csv('file.csv')

# knn = knn_descent(data, k=10)

# viz(knn)

from data.csv_reader import reader
from algorithms.knn import knn_brute_force
from algorithms.knn import knn_descent

k = 3
graph = reader("/home/karim/Workspace/github.com/me/iko/datasets/data.csv")

knn_graph = knn_descent.get_knn(graph, k)
knn_descent.print_knn(knn_graph)

# knn_graph = knn_brute_force.get_knn(graph, k)
# knn_brute_force.print_knn(knn_graph)
Esempio n. 7
0
 def test_reader(self):
     from data import csv_reader
     file_result = open('testing_results.csv')
     csv_tester_od_reader_type = csv.reader(file_result, delimiter=",")
     self.assertEqual(type(csv_tester_od_reader_type),
                      type(csv_reader.reader('../data/results.csv')))