This repository contains NumPy implementation of multi-layer perceptron.
cd src
pip install -U requirements.txt
- Create a Jupyter lab file
jupyter lab Experiment.ipynb
- Load libraries
from src.utils import split_data
from src.utils import standardize_data
from src.utils import performance_metrics
from src.nn import NeuralNetworkClassifier
from src.utils import visualize_decision_boundary
- Load Data
data = np.load("data/processed/processed_data.npz")
X_test = data['X_test']
y_test = data['y_test']
- Load Model and Predict
import joblib
clf = joblib.load("models/mlp.sav")
y_prob = clf.predict(X_test)
y_pred = np.argmax(y_prob, axis=1)
- Visualize Decision Boundry
plt.figure(figsize=(12,5))
plt.subplot(1, 2, 1)
plt.title("Train")
visualize_decision_boundary(model=clf, X=X_train, y=y_train)
plt.subplot(1, 2, 2)
plt.title("Test")
visualize_decision_boundary(model=clf, X=X_test, y=y_test)
plt.show()