Python Forum

Full Version: how to predict next value taking in account several variables?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Everyone, I am looking for a way to predict the next value of a Variable like 'linear regression' but taking in account other Variables that happens the same day:

Date Var1 Var2 Var3 Var4
02/07/2017 31 20 12 0
03/07/2017 43 12 16 3
04/07/2017 57 4 26 16
05/07/2017 37 15 31 19
06/07/2017 74 8 15 23
07/07/2017 75 22 16 38
08/07/2017 90 14 21 4
09/07/2017 59 7 10 12
10/07/2017 32 33 34 17
11/07/2017 40 18 25 6
12/07/2017 108 12 32 7
Legend:
Var1= Amount of cars in the street
Var2= Amount of people in the street
Var3= Amount of motorcycle in the street
Var4= Amount of dogs in the street

So how can I make a script in python that predicts next value of 'Var1' taking in account the Var1 history and also the history of Var2, Var3, Var4 ..

I think that if this can be done maybe I could gain more accuracy in the prediction.
you can fit the data to a curve. Once done the unknowns can found by applying against the curve
see: https://docs.scipy.org/doc/scipy/referen...gress.html
That's called multiple linear regression, and requires matrix algebra and eigenvectors. It looks like the sklearn module can do it: https://stackoverflow.com/questions/1147...-in-python