0

The code is fine and running for train & test data, but for the sample input it's showing an error while predicting data:

test1 = pd.DataFrame(data=np.array(['MBBS', 'Psychiatrist', 8, 'Dadar', 'Mumbai', 10, 1],dtype=object).reshape(1,7))

pipe.predict(test1)

Traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-327-fbf961ba00a2> in <module>
----> 1 pipe.predict(test1)

2 frames
/usr/local/lib/python3.8/dist-packages/sklearn/compose/_column_transformer.py in transform(self, X)
    740             diff = all_names - set(X.columns)
    741             if diff:
--> 742                 raise ValueError(f"columns are missing: {diff}")
    743         else:
    744             # ndarray was used for fitting or transforming, thus we only

ValueError: **columns are missing: {'Recommendation', 'Feedback', 'Experience'}**
Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34

0 Answers0