I have a model which takes 2D input data and does multi class classification in keras. I would like to plot the probability calibration curve. However, using the scikit function, it returns an error saying that it cannot process 2D data. Please help.
My code is:
model= custom_model() # define and fit calibration model calibrated = CalibratedClassifierCV(model, method='sigmoid', cv=5) calibrated.fit(x_train, y_train)
The error is:
Traceback (most recent call last): File "<ipython-input-41-bcfb033e1749>", line 1, in <module> yhat_calibrated = calibrated(x_train, x_test, y_train) File "<ipython-input-39-a3023fc5b92f>", line 100, in calibrated calibrated.fit(x_train, y_train) File "/home/eee/anaconda3/lib/python3.6/site-packages/sklearn/calibration.py", line 133, in fit force_all_finite=False) File "/home/eee/anaconda3/lib/python3.6/site-packages/sklearn/utils/validation.py", line 756, in check_X_y estimator=estimator) File "/home/eee/anaconda3/lib/python3.6/site-packages/sklearn/utils/validation.py", line 570, in check_array % (array.ndim, estimator_name)) ValueError: Found array with dim 3. Estimator expected <= 2.
If not scikit, are there any other libraries that can help?