Using Random forest model I generated the following predictive probabilities for class 0, and class 1 which is 2 dimensional array.
yhatrf =RF.predict_proba(X_test)
yhatrf
array([[0.70388125, 0.29611875],
[0.70388125, 0.29611875],
[0.71744657, 0.28255343],
...,
[0.70388125, 0.29611875],
[0.70388125, 0.29611875],
[0.71744657, 0.28255343]])
I used the above probabilities to plot the following gain curve
import scikitplot as skplt
skplt.metrics.plot_cumulative_gain(y_test, yhatrf)
plt.show()
Not sure why I don't see any curve for class 0!
Now I want to plot the same plot using LSTM model. From LSTM model I have 1D array of probabilities. I am not sure how can I make it 2D array like Random forest.
y_test_prob = lstm.predict(X_test,verbose=1)
array([[0.34313112],
[0.34313428],
[0.34313485],
...,
[0.7425977 ],
[0.27715954],
[0.32574904]], dtype=float32)
I used the following code to generate label predictions from LSTM model. I couldn't plot the gain curve using LSTM model predictions. How can I plot gain curve for LSTM?
y_test_pred= np.where(y_test_prob > 0.5, 1, 0)