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
Databricks Employee
Databricks Employee

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!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group