From 2a5a423571cc566770414ce6df84542c7afffc7d Mon Sep 17 00:00:00 2001 From: PerryXDeng Date: Sat, 30 Mar 2019 18:01:28 -0400 Subject: [PATCH] more correlation --- .../cleaned/expSmoothWorkAndFatigueData.csv | 2 +- findings/r2correlation.txt | 3 ++- hypotheses_modeling/team_regressions.py | 10 +++++++--- hypotheses_modeling/time_series_days_ranked.csv | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/data_preparation/cleaned/expSmoothWorkAndFatigueData.csv b/data_preparation/cleaned/expSmoothWorkAndFatigueData.csv index df1b22e..54a374d 100644 --- a/data_preparation/cleaned/expSmoothWorkAndFatigueData.csv +++ b/data_preparation/cleaned/expSmoothWorkAndFatigueData.csv @@ -1,4 +1,4 @@ -"","day","totalWork","averageWorkLoad","smoothedWork","smoothedFatigueData" +"","TimeSinceAugFirst","totalWork","averageWorkLoad","smoothedWork","smoothedFatigueData" "1",0,4855,255.526315789474,4855,0.734457489003587 "2",1,1380,138,5921.8864123285,1.17226558337237 "3",2,6030,231.923076923077,11569.9661032971,1.37713723445689 diff --git a/findings/r2correlation.txt b/findings/r2correlation.txt index aff54e3..d08f825 100644 --- a/findings/r2correlation.txt +++ b/findings/r2correlation.txt @@ -1,4 +1,5 @@ Document Linear Relationship 7 day moving average team workload - normalized team fatigue: 0.0006 21 day moving average team workload - normalized team fatigue: 0.0024 - +normalized team fatigue - game day performance: 0.0696 +normalized team fatigue - paper smoothed workload fatigue: 0.0324 diff --git a/hypotheses_modeling/team_regressions.py b/hypotheses_modeling/team_regressions.py index 51c3d17..5753708 100644 --- a/hypotheses_modeling/team_regressions.py +++ b/hypotheses_modeling/team_regressions.py @@ -17,7 +17,11 @@ def k_days_into_future_regression(X, y, k, n0): out = [] for day in y[col][n0 - 1:]: prev = day - k - xprev = X[X[col] == prev].drop(columns=[col]).to_numpy()[0, :] + xprev = X[X[col] == prev].drop(columns=[col]).to_numpy() + if xprev.shape[0] != 1: + continue + else: + xprev = xprev[0, :] yt = y[y[col] == day].drop(columns=[col]).to_numpy()[0, :] inp.append(xprev) out.append(yt) @@ -31,8 +35,8 @@ def k_days_into_future_regression(X, y, k, n0): def main(): fatigueSums = pd.read_csv("fatigue_total_sum.csv") - workMovingAverage21 = pd.read_csv("21DaySlidingWorkAverage.csv", index_col=0) - print(k_days_into_future_regression(workMovingAverage21, fatigueSums, 0, 21)) + performance = pd.read_csv("../data_preparation/cleaned/expSmoothWorkAndFatigueData.csv", index_col=0).drop(columns=["totalWork", "averageWorkLoad", "smoothedFatigueData"]) + print(k_days_into_future_regression(fatigueSums, performance, 0, 1)) if __name__ == "__main__": diff --git a/hypotheses_modeling/time_series_days_ranked.csv b/hypotheses_modeling/time_series_days_ranked.csv index 8e0b9e7..b64b2f7 100644 --- a/hypotheses_modeling/time_series_days_ranked.csv +++ b/hypotheses_modeling/time_series_days_ranked.csv @@ -1,4 +1,4 @@ -,Date,DailyElo +,TimeSinceAugFirst,DailyElo 0,121,0.0 1,122,-3.714599999999998 2,178,0.04346000000000028