cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

EOFError trying to assign a model using a custom module

jdigiovanni
New Contributor

I'm in a Data Science Bootcamp, and the final case study includes data preprocessing (done), using a linear regression model on the data, then porting to SQL for visualization. The model build uses custom python code provided as part of the exercise. I've attached that code, and the two files that the code pickles.

Python command used:

model = absenteeism_model('/dbfs/FileStore/shared_uploads/1009276498.DIGIOVANN/model', '/dbfs/FileStore/shared_uploads/1009276498.DIGIOVANN/scaler')

Even with the explicit path provided to these files, I get the error below.

EOFError Traceback (most recent call last)

<command-725274> in <module>

----> 1 model = absenteeism_model('/dbfs/FileStore/shared_uploads/1009276498.DIGIOVANN/model', '/dbfs/FileStore/shared_uploads/1009276498.DIGIOVANN/scaler')

/dbfs/FileStore/shared_uploads/1009276498.DIGIOVANN/absenteeism_module.py in __init__(self, model_file, scaler_file)

41 with open('model','rb') as model_file, open('scaler', 'rb') as scaler_file:

42 self.reg = pickle.load(model_file)

---> 43 self.scaler = pickle.load(scaler_file)

44 self.data = None

45

EOFError: Ran out of input

3 REPLIES 3

Anonymous
Not applicable

Prabakar
Esteemed Contributor III
Esteemed Contributor III

It would be great if you could share the full stack trace to check what happened.

Vidula
Honored Contributor

Hi @Joe DiGiovanni​ 

Just wanted to check in if you were able to resolve your issue or do you need more help? We'd love to hear from you.

Thanks!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!