Confusion Matrix of LSTM using Sklear getting error
A confusion matrix can be drawn for a classification problem, where the Machine Learning Model (in your case LSTM) predicts the target variable into one of the N classes.

Can you confirm that your problem is a Classification problem and not a Regression one?

If in case you have a regression problem, then you might want to use a different evaluation metric.