Comments (3)
Include the below code
X_test = X_test.to_numpy()
before executing this
x_test = np.reshape(X_test, (X_test.shape[0],X_test.shape[1],1))
This will fix the problem.
Closing the issue. Reopen if this issue arises again.
from network-intrusion-detection-using-machine-learning.
Abhinav, thank you so much!
Do you have LSTM Classifier (Multi-class Classification).
Moreover, I would want to use SHAP (SHapley Additive exPlanations), to explain the hidden layer and your model (KNN and LSTM), to see what features are the top important features while determining the result of model. however, there has some bugs.. I am so sorry to disturb you. but I spend a week to debug still got nothing. It will be great thankful if you have time to take a look! Thank you so much! Wish you have a nice weekend.
KNN SHAP explainer
`!pip install shap
import shap
knn_explainer = shap.KernelExplainer(knn.predict,X_test)
knn_shap_values = knn_explainer.shap_values(X_test)
shap.summary_plot(knn_shap_values, X_test)
shap.dependence_plot("intrusion", knn_shap_values, X_test)
shap.force_plot(knn_explainer.expected_value,knn_shap_values[10,:], X_test.iloc[10,:])
shap.force_plot(knn_explainer.expected_value, knn_shap_values, X_test)`
LSTM SHAP explainer
`import shap
explainer = shap.DeepExplainer(lstm, x_train)
shap_values = explainer.shap_values(x_test)
shap.initjs()`
from network-intrusion-detection-using-machine-learning.
@klcheung99 Thank you for mentioning this. At the moment I don't have LSTM for Multi-class but I will make sure to include that soon. Also, I will look into the SHAP issue.
from network-intrusion-detection-using-machine-learning.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from network-intrusion-detection-using-machine-learning.