Browse Source

commented linear regression

master
PerryXDeng 5 years ago
parent
commit
787313b8a3
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      hypotheses_modeling/team_regressions.py

+ 8
- 0
hypotheses_modeling/team_regressions.py View File

@ -4,6 +4,14 @@ from sklearn.metrics import mean_squared_error, r2_score
def k_days_into_future_regression(X, y, k, n0): 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" col = "TimeSinceAugFirst"
inp = [] inp = []
out = [] out = []

Loading…
Cancel
Save