0

I have a question regarding scikit-learn. I would like to know if it is possible to tell scikit-learn to use moving average values as my label values? I have historic data like: team1,team2, run_distance1, run_distance2 and would like to use the mean of the last 3 run_distance1 as the current value. Does sci-kit have this kind of feature?

The idea behind this is to predict the current match of team1 and team2 by using the historic data trained on moving average values (mean) of the last 3 or X games.

Thank you very much!

zer02
  • 3,963
  • 4
  • 31
  • 66
  • 1
    But what is the problem with just adding new feature to original dataset, naming it mean3_run_distance1, and populating with mean value of last 3 run_distance1? After that just feed the dataset to any regression algorithm you want. – Maksim Khaitovich Apr 23 '15 at 15:29
  • Thanks, I just wanted to know if there are like some built-in functions except from mean. – zer02 Apr 23 '15 at 20:37
  • 1
    Well, I believe there are tools which could just transform your original data to moving average data. You could use a small function in one of responses here (the one based on convolve is rather fast): http://stackoverflow.com/questions/13728392/moving-average-or-running-mean. Then use the transformed data as regression input - it will also work nicely. – Maksim Khaitovich Apr 24 '15 at 15:17

0 Answers0