Open Mvenkateswaramma opened 1 year ago
@aschauhan22 can you take a look at this issue?
In my case I have the following error: FileNotFoundError: [Errno 2] No such file or directory: '../output/models/xgb.pkl' In fact there is no file: '../output/models/xgb.pkl'
And when I try to train the model, I get another error:
ValueError: Invalid classes inferred from unique values of y
. Expected: [0 1 2 3 4], got ['business' 'entertainment' 'politics' 'sport' 'tech']
I used LabelEncoder() and train the model and dump it to the folder.
Hello azure-openai-samples/fundamentals/document_analysis/ 03-classify-documents.ipynb Below is the script that I have executed and getting an below error message. Error: NotFittedError: need to call fit or load_model beforehand, Though I have called fit/Load functions still getting an exception, could you please take a look and do the needful. Thanks
Below is the script.
import xgboost as xgb from xgboost import XGBClassifier import pickle
TRAIN = False LOAD = True
filename for trained model
fname = ('../output/models/xgb.pkl')
if TRAIN:
create model instance
load the model from disk
if LOAD: with open(fname, "rb") as f: xgb= pickle.load(f)
predict
preds = xgb.predict(X_test) probas = xgb.predict_proba(X_test)
report
report = classification_report(y_test, preds) print(report)