Python Forum
predicting values at point in time
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
predicting values at point in time
#2
Missed the regression library call in previous post, here is the full program:

import pandas as pd
from sklearn import linear_model
import statsmodels.api as sm
 
df=pd.read_csv("C:/Users/ABCDE/Downloads/PyTestdata.csv")
 
display(df)
 
X = df[['no_of_tables','total_rows_in_mill','total_bytes_gb']] # here we have 3 variables for multiple regression. 
Y = df['average_load_time']

# with sklearn
regr_avg_load_time = linear_model.LinearRegression()
regr_avg_load_time.fit(X, Y)
 
print('Intercept: \n', regr_avg_load_time.intercept_)
print('Coefficients: \n', regr_avg_load_time.coef_)
 
new_no_of_tables=20
new_total_rows_in_mill=80
new_total_bytes_gb=20
 
print ('Predicted average_load_time: \n', regr_avg_load_time.predict([[new_no_of_tables ,new_total_rows_in_mill,new_total_bytes_gb]]))
Reply


Messages In This Thread
predicting values at point in time - by mk1216 - May-07-2019, 01:52 PM
RE: predicting values at point in time - by mk1216 - May-07-2019, 03:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Predicting/Forecasting Future Values BadWhite 1 2,358 Jun-15-2020, 11:30 AM
Last Post: hussainmujtaba
  Predicting an output variable with sklearn Ccross1 1 2,519 Jun-04-2019, 03:11 PM
Last Post: michalmonday

Forum Jump:

User Panel Messages

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