https://github.com/grantgasser/task2
Multiclass classification
https://github.com/grantgasser/task2
keras multiclass-classification neural-network
Last synced: 2 months ago
JSON representation
Multiclass classification
- Host: GitHub
- URL: https://github.com/grantgasser/task2
- Owner: grantgasser
- Created: 2018-03-26T13:55:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-04T22:11:30.000Z (over 7 years ago)
- Last Synced: 2025-04-03T04:18:09.131Z (about 1 year ago)
- Topics: keras, multiclass-classification, neural-network
- Language: Jupyter Notebook
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Task 2: 3-Class Classification
This was a group project, but the code in this notebook is solely mine.
This program uses [keras](https://keras.io/).
### Description
Loading the data and pre-processing was quite similar to previous tasks as the format of the data has stayed consistent. The only difference now is that the this is a 3-class classification task with the labels as 0, 1, and 2. We read the data from the train and test csv files into pandas dataframes representing the x training data, y training data, and x testing data. After trying One v. One and One v. Rest classification, we decided to implement a neural network in order to exceed the Hard baseline. Using keras, we defined a model, adding a 2 hidden layers, and a 'softmaxed' output layer. We used ReLU as the activation function for the other layers. Then, calling the keras compile function, we defined the loss function as categorical cross-entropy and used the Adam optimizer. Subsequently, we converted the y labels to an 'encoded' matrix in order to use it in Keras. We trained the model for 200 epochs and achieved an accuracy of **91.3%**. Despite that, we figured the model would perform a little worse once uploaded, since it may have over-fitted just a little.