Skip to content Skip to sidebar Skip to footer

How To Extend Predicted Value?

This is the sample code which I got from this link import pandas as pd from sklearn import linear_model import statsmodels.api as sm Stock_Market = {'Year': [2017,2017,2017,2017,2

Solution 1:

try this:

New_Interest_Rate = [2.75, 3, 4, 1, 2]
New_Unemployment_Rate = [5.3, 4, 3, 2, 1]
for i in range(len(New_Interest_Rate)):
    print (str(i+1) + ' - Predicted Stock Index Price: \n', 
           regr.predict([[New_Interest_Rate[i] ,New_Unemployment_Rate[i]]]))

instead of these lines:

New_Interest_Rate = 2.75
New_Unemployment_Rate = 5.3print ('Predicted Stock Index Price: \n', regr.predict([[New_Interest_Rate ,New_Unemployment_Rate]]))

Post a Comment for "How To Extend Predicted Value?"