Browse Source

Add regression calcs on personal.csv

master
Ryan Missel 5 years ago
parent
commit
84c3bb6cd2
2 changed files with 73 additions and 5 deletions
  1. +56
    -0
      hypotheses_modeling/ryan_regressions.txt
  2. +17
    -5
      hypotheses_modeling/team_regressions.py

+ 56
- 0
hypotheses_modeling/ryan_regressions.txt View File

@ -0,0 +1,56 @@
Player 9 for acuteChronicRatio
(1.5543991777375237, array([-0.13902363, -0.0050734 ]), 0.43833525766886916, 0.0008867324974165428)
(0.48957502323211444, 0.5699208996736808)
Player 11 for acuteChronicRatio
(1.3258336437888891, array([ 0.00685405, -0.00203877]), 0.11479264860906191, 0.00096573215060248)
(0.4626369870793939, 0.44423100028132423)
Player 9 for sleepQuality
(5.334340148618029, array([ 1.02125114, -0.00432071]), 0.6539555377710119, 0.0012466268315319546)
(0.597372726628557, 0.7193845945200593)
Player 12 for sleepQuality
(3.584632145668627, array([0.41485048, 0.00088306]), 0.34499328173976607, 0.0006803191826778461)
(0.4600451787749952, 0.4227561697627662)
Player 3 for soreness
(3.2022109874813864, array([ 4.19185564e-01, -1.39780603e-04]), 0.4252210971285296, 0.0006688273367686844)
(0.4674558844267985, 0.468022382169041)
Player 7 for soreness
(3.077085467389001, array([4.26722267e-01, 5.78941104e-05]), 0.39740866670470376, 0.0007515523424419748)
(0.49988907759269197, 0.4324080355741665)
Player 9 for soreness
(5.246967544538162, array([ 0.71359643, -0.00715268]), 0.5944763974272957, 0.0019117577400940124)
(0.7765705044770445, 0.637614880294574)
Player 3 for sorenessNorm
(0.12141700921277873, array([ 0.58776641, -0.00068588]), 0.36954097046558354, 0.0017457549720592538)
(0.7372571250720799, 0.443920566690573)
Player 9 for sleepQualityNorm
(0.08976795719049747, array([ 7.62990183e-01, -4.56901189e-04]), 0.5858342550214043, 0.0005114756024138036)
(0.40337948626285336, 0.6267479812123391)
Player 12 for sleepQualityNorm
(0.0030010445831953553, array([ 5.97640029e-01, -1.59341568e-05]), 0.3568843263232311, 0.00117522635306064)
(0.6154637522814207, 0.4127840710858218)
Player 3 for BestOutOfMyselfAbsolutely
(0.5591113560131244, array([-0.06273135, 0.00144052]), 0.19693367374327753, 0.00034431962962114574)
(0.29946330051959735, 0.4074811906349808)
Player 9 for BestOutOfMyselfAbsolutely
(0.6212790914046262, array([ 0.23297634, -0.00209794]), 0.49210290965481174, 0.0002682490835151878)
(0.2897694328560262, 0.5496315964616945)
Player 3 for BestOutOfMyselfUnknown
(0.45258982162191874, array([ 0.0601493 , -0.00149072]), 0.20252316026232742, 0.0003459027048924739)
(0.2980996120964688, 0.41962026820540466)
Player 9 for BestOutOfMyselfUnknown
(0.34069195794958324, array([-0.22074479, 0.00217018]), 0.4646199842752917, 0.0003011772648087732)
(0.3048702214016301, 0.5319467359793901)

+ 17
- 5
hypotheses_modeling/team_regressions.py View File

@ -60,12 +60,24 @@ def poly_regression(x, y, degree):
def main():
file = open("ryan_regressions.txt", 'w')
player = pd.read_csv("../data_preparation/cleaned/personal.csv", index_col=0)
player = player[player['playerID'] == 1]
x = player[['fatigueNorm', 'day']]
y = player['sorenessNorm']
print(standard_lr(x, y))
print(poly_regression(x, y, 5))
for name, value in player.iteritems():
if name == "day":
continue
for j in range(1, 17):
ply = player[player['playerID'] == j]
x = ply[['fatigueNorm', 'day']]
y = ply[name]
lr = standard_lr(x, y)
poly = poly_regression(x, y, 3)
if .9 > lr[2] > .4 or .9 > poly[1] > .4:
file.write("Player {} for {}\n".format(j, name))
file.write("{}\n".format(lr))
file.write("{}\n\n".format(poly))
if __name__ == "__main__":

Loading…
Cancel
Save