I trained a few models, and then picked the best one from model directory, was trying to predict new data, then error came up.
Traceback (most recent call last):
File "test_best_model.py", line 21, in <module>
preds = best_model.predict(X)
File "/medical_data/Datasets/ATM/atm/model.py", line 209, in predict
X, _ = self.encoder.transform(data)
File "/medical_data/Datasets/ATM/atm/encoder.py", line 101, in transform
features = data[self.feature_columns]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
I use pickle to load the model:
with open(classfier_p, 'rb') as f:
best_model= pickle.load(f)
I trained a few models, and then picked the best one from model directory, was trying to predict new data, then error came up.
I use pickle to load the model: