Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
"Guiding Future STEM Leaders through Innovative Research Training" ~ thinkingbeyond.education
Image: ubuntu2204
This code compares Multi-Layer Perceptron(MLP) with Kolmogorov Arnold Network (KAN) on the Wisconsin Breast Cancer Dataset. Each model is run with one hidden layer, tested over different width of the layer. The code test each model over a moderate width(27 neurons per layer), a larger width(64 neurons per layer) and a smaller width(18 neurons per layer) GridSearchCV was used by both models to calculate the best parameters and hyperparameters for the number of layer and neurons per layer chosen
The result shows smooth covergence between each of the models,MLP had a very quick execution time and minumum loss unlike the KAN which took longer time to be executed and had a higher loss. Though, both models had similar accuracy score over the unseen data.
##Import Necessary Libraries
##Models The models are being called here along with the default number of layers and hyperparameter
#Functions All the functions to be used for calculating the accuracies, losses, precision, recall, confusion matrix. The function to plot the graph is also written here.
##Model Functions
##Model Run Function
##Plot Function
##Comparison Criteria Functions
##KAN Hyperparameter Tunning Function
#Dataset The dataset to be used for the analysis is loaded here as well as preparation for the dataset using standard scaler(to make every feature have a mean of 0 and a standard deviation of 1) for faster convergence and imporved performance
##Load Dataset
##Prepare Dataset
Runing the model
Running the models over 100 epochs with different neurons per layer for MLP and KAN
Plotting the accuracies and loss over epochs
Calculating other comparison criteria