Python Forum
how to predict next value taking in account several variables?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to predict next value taking in account several variables?
#1
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.
Reply
#2
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
Reply
#3
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
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to use .predict() method Jack90_ 4 699 Nov-03-2023, 08:21 PM
Last Post: Larz60+
  How to predict Total Hours needed with List as Input? caninan 0 761 Jan-27-2023, 04:20 PM
Last Post: caninan
  Which network architecture should be chosen to predict disease severity? AlekseyPython 2 1,960 Aug-21-2021, 07:12 PM
Last Post: jefsummers
  How to predict output in a regression problem? Rezaafz 1 2,471 Apr-03-2021, 04:16 PM
Last Post: jefsummers
  Keras.Predict into Dataframe Finpyth 13 9,586 Aug-31-2020, 07:22 AM
Last Post: hussainmujtaba
  Analyze, predict the next step in a sequence. Antonio0608 0 1,972 Jul-23-2020, 05:53 PM
Last Post: Antonio0608
  Error When Using sklearn Predict Function firebird 0 2,025 Mar-21-2020, 04:34 PM
Last Post: firebird
  Predict Longitude and Latitude Using Python vibeandvisualize 1 2,249 Dec-27-2019, 12:10 PM
Last Post: Larz60+
  How to predict with date as input for DecisionTreeRegressor sandeep_ganga 0 1,784 Dec-12-2019, 03:29 AM
Last Post: sandeep_ganga
  Can someone explain how does svr_rbf.predict(dates) work? j2ee 0 3,501 Feb-22-2018, 06:50 PM
Last Post: j2ee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020