0

I have a code that basically takes in a csv, which can be uploaded from streamlit and then pushes out a classification prediction.

Just as a context I use xgboost to create my model and I save it as following:

joblib.dump(model, 'C:\\Users\myname\classification\default_class_model.pkl')

To grab the model I do:

model_from_joblib =joblib.load('C:\\Users\myname\classification\default_class_model.pkl')
scoring = model_from_joblib.predict(X_test)

When I execute it in Jupyter notebooks it seems to work just fine, but when running on anaconda and do streamlit run mymodel.py

I get the error:

XGBoostError: [13:38:10] C:\Users\Administrator\workspace\xgboost-win64_release_1.1.0\include\xgboost/json.h:65: Invalid cast, from Null to Array

Does anyone have an idea why this may be?

mblume
  • 243
  • 1
  • 3
  • 11
  • Don't use notebook, don't use streamlit, now use only anaconda does model prediction works? – ferdy Apr 16 '22 at 23:36

1 Answers1

0

I solved the problem by updating the xgboost version I was using

mblume
  • 243
  • 1
  • 3
  • 11