Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

xgb model prediction changes if i save and load the model

import pickle
file_name = "xgb_reg.pkl"

# save
pickle.dump(xgb_model, open(file_name, "wb"))

# load
xgb_model_loaded = pickle.load(open(file_name, "rb"))

# test
ind = 1
test = X_val[ind]
xgb_model_loaded.predict(test)[0] == xgb_model.predict(test)[0]

Out[1]: True
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #xgb #model #prediction #save #load #model
ADD COMMENT
Topic
Name
6+2 =