Answered step by step
Verified Expert Solution
Question
1 Approved Answer
what do I need to change in my excel file/Phyton in order for it to run #Load Saved Model import pickle filename = 'reg_model_save. sav'
what do I need to change in my excel file/Phyton in order for it to run
\#Load Saved Model import pickle filename = 'reg_model_save. sav' loaded_model = pickle.load(open(filename, ' rrb ')) \#rb - read binary same as open model/file \#Predict import statsmodels.api as sm input_new =sm. add_constant ( input_new ) predict output = loaded model.predict (input new) Huse the feature scalling variable to predict using save model predict_output = pd. DataFrame( { 'Predicted Price': predict_output } ) \#Create Data Frame ValueError Traceback (most recent call last) 2 import statsmodels.api as sm 3 input_new =5m. add_constant ( input_new ) 4 predict_output = loaded_model.predict(input_new) \#use the feature scalling variable to predict using save model 5 predict_output = pd.DataFrame( { 'Predicted Price':predict_output }) \#Create Data Frame 2 frames /usr/local/lib/python 3.8/ dist-packagesumpy/core/overrides.py in dot(*args, **kwargs) ValueError: shapes (5000,4) and (5,)notaligned:4 (dim 1) 1=5 (dim ) SEARCH STACK OVERFLOWStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started