Exemplo n.º 1
0
import pickle
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import numpy as np
from dataFrameUtilities import selectTime, selectColumns, addRollingMeanColumns

input = open('data.txt', 'rb')
data = pickle.load(input)
input.close()

timeSelected = selectTime(data, '2016-01-15', '2019-03-06')

pain = selectColumns(timeSelected, ['forearmElbowPain'])
pain = addRollingMeanColumns(pain, ['forearmElbowPain'], 21)

timeSelected[
    'swimAndSurf'] = timeSelected['swimming'] + timeSelected['surfing']
timeSelected['climbs'] = timeSelected['climbing'] + timeSelected['viaFerrata']

env = addRollingMeanColumns(timeSelected,
                            ['whatPulseT', 'swimAndSurf', 'climbs'], 21)

envOrdi = env[['whatPulseT']]
envSport = env[['swimAndSurf', 'climbs']]
envSportMean = env[[
    'whatPulseTRollingMean', 'swimAndSurfRollingMean', 'climbsRollingMean'
]]

fig, axes = plt.subplots(nrows=4, ncols=1)
Exemplo n.º 2
0
import pickle

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from dataFrameUtilities import addRollingMeanColumns, selectColumns, selectTime
from sklearn.preprocessing import MinMaxScaler

input = open("data.txt", "rb")
data = pickle.load(input)
input.close()

timeSelected = selectTime(data, "2016-01-15", "2019-03-06")

pain = selectColumns(timeSelected, ["forearmElbowPain"])
pain = addRollingMeanColumns(pain, ["forearmElbowPain"], 21)

timeSelected[
    "swimAndSurf"] = timeSelected["swimming"] + timeSelected["surfing"]
timeSelected["climbs"] = timeSelected["climbing"] + timeSelected["viaFerrata"]

env = addRollingMeanColumns(timeSelected,
                            ["whatPulseT", "swimAndSurf", "climbs"], 21)

envOrdi = env[["whatPulseT"]]
envSport = env[["swimAndSurf", "climbs"]]
envSportMean = env[[
    "whatPulseTRollingMean", "swimAndSurfRollingMean", "climbsRollingMean"
]]

fig, axes = plt.subplots(nrows=4, ncols=1)
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from dataFrameUtilities import addRollingMeanColumns, selectColumns, selectTime
from sklearn.preprocessing import MinMaxScaler

input = open("../data/preprocessed/preprocessedDataParticipant1.txt", "rb")
data = pickle.load(input)
input.close()

timeSelected = selectTime(data, "2016-03-01", "2019-03-06")

timeSelected["foreheadAndEyesPain"] = timeSelected[
    "foreheadAndEyesPain"] + timeSelected["aroundEyesPain"]
pain = selectColumns(timeSelected, ["foreheadAndEyesPain"])
pain = addRollingMeanColumns(pain, ["foreheadAndEyesPain"], 21)

env = addRollingMeanColumns(timeSelected,
                            ["manicTimeT", "eyeRelatedActivities"], 21)
envRollingMean = selectColumns(
    env, ["manicTimeTRollingMean", "eyeRelatedActivitiesRollingMean"])
envBrut = selectColumns(env, ["manicTimeT", "eyeRelatedActivities"])

fig, axes = plt.subplots(nrows=3, ncols=1)

pain.plot(ax=axes[0])
envBrut.plot(ax=axes[1])
envRollingMean.plot(ax=axes[2])

leg = plt.legend(loc="best")
leg.set_draggable(True)
Exemplo n.º 4
0
import pickle
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import numpy as np
from dataFrameUtilities import selectTime, selectColumns, addRollingMeanColumns

input = open('data.txt', 'rb')
data = pickle.load(input)
input.close()

timeSelected = selectTime(data, '2016-01-15', '2019-03-06')

pain = selectColumns(timeSelected, ['handsAndFingerPain'])
pain = addRollingMeanColumns(pain, ['handsAndFingerPain'], 21)

timeSelected[
    'swimAndSurf'] = timeSelected['swimming'] + timeSelected['surfing']
timeSelected['climbs'] = timeSelected['climbing'] + timeSelected['viaFerrata']

env = addRollingMeanColumns(timeSelected,
                            ['whatPulseT', 'swimAndSurf', 'climbs'], 21)

envOrdi = env[['whatPulseT']]
envSport = env[['swimAndSurf', 'climbs']]
envSportMean = env[[
    'whatPulseTRollingMean', 'swimAndSurfRollingMean', 'climbsRollingMean'
]]

fig, axes = plt.subplots(nrows=4, ncols=1)
Exemplo n.º 5
0
import pickle

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from dataFrameUtilities import addRollingMeanColumns, selectColumns, selectTime

input = open("data.txt", "rb")
data = pickle.load(input)
input.close()

timeSelected = selectTime(data, "2016-09-01", "2019-10-20")

pain = selectColumns(timeSelected, ["kneePain"])
pain = addRollingMeanColumns(pain, ["kneePain"], 21)

env = addRollingMeanColumns(timeSelected, ["steps", "denivelation"], 21)
envRollingMean = selectColumns(env,
                               ["stepsRollingMean", "denivelationRollingMean"])
envBrut = selectColumns(env, ["steps", "denivelation"])

fig, axes = plt.subplots(nrows=3, ncols=1)

pain.plot(ax=axes[0])
envBrut.plot(ax=axes[1])
envRollingMean.plot(ax=axes[2])

plt.legend(loc="best")
plt.show()
Exemplo n.º 6
0
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import numpy as np
from dataFrameUtilities import selectTime, selectColumns, addRollingMeanColumns

input = open('data.txt', 'rb')
data = pickle.load(input)
input.close()

timeSelected = selectTime(data, '2016-03-01', '2019-03-06')

timeSelected['foreheadAndEyesPain'] = timeSelected[
    'foreheadAndEyesPain'] + timeSelected['aroundEyesPain']
pain = selectColumns(timeSelected, ['foreheadAndEyesPain'])
pain = addRollingMeanColumns(pain, ['foreheadAndEyesPain'], 21)

env = addRollingMeanColumns(timeSelected,
                            ['manicTimeT', 'eyeRelatedActivities'], 21)
envRollingMean = selectColumns(
    env, ['manicTimeTRollingMean', 'eyeRelatedActivitiesRollingMean'])
envBrut = selectColumns(env, ['manicTimeT', 'eyeRelatedActivities'])

fig, axes = plt.subplots(nrows=3, ncols=1)

pain.plot(ax=axes[0])
envBrut.plot(ax=axes[1])
envRollingMean.plot(ax=axes[2])

plt.legend(loc='best')
plt.show()
import pickle

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from dataFrameUtilities import addRollingMeanColumns, selectColumns, selectTime
from sklearn.preprocessing import MinMaxScaler

input = open("data.txt", "rb")
data = pickle.load(input)
input.close()

timeSelected = selectTime(data, "2016-01-15", "2019-03-06")

pain = selectColumns(timeSelected, ["handsAndFingerPain"])
pain = addRollingMeanColumns(pain, ["handsAndFingerPain"], 21)

timeSelected["swimAndSurf"] = timeSelected["swimming"] + timeSelected["surfing"]
timeSelected["climbs"] = timeSelected["climbing"] + timeSelected["viaFerrata"]

env = addRollingMeanColumns(timeSelected, ["whatPulseT", "swimAndSurf", "climbs"], 21)

envOrdi = env[["whatPulseT"]]
envSport = env[["swimAndSurf", "climbs"]]
envSportMean = env[
    ["whatPulseTRollingMean", "swimAndSurfRollingMean", "climbsRollingMean"]
]

fig, axes = plt.subplots(nrows=4, ncols=1)

pain.plot(ax=axes[0])