From 787313b8a346c47716eb75f38910c0af0064c84b Mon Sep 17 00:00:00 2001 From: PerryXDeng Date: Sat, 30 Mar 2019 17:22:50 -0400 Subject: [PATCH] commented linear regression --- hypotheses_modeling/team_regressions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hypotheses_modeling/team_regressions.py b/hypotheses_modeling/team_regressions.py index 758c864..32953ca 100644 --- a/hypotheses_modeling/team_regressions.py +++ b/hypotheses_modeling/team_regressions.py @@ -4,6 +4,14 @@ from sklearn.metrics import mean_squared_error, r2_score def k_days_into_future_regression(X, y, k, n0): + """ + linear regression that returns the fitted weights as well as metrics + :param X: x timeseries dataframe (very clean, no unamed columns), multidimensional rows + :param y: y timeseries dataframe (very clean, no unamed columns), scalar rows + :param k: days predicting in advance + :param n0: ignoring the first n0 days + :return: intercept, slopes, correlation, mean squared error + """ col = "TimeSinceAugFirst" inp = [] out = []