Classes and Functions used: Numpy, Pandas, KerasClassifier, Cross validation score, K fold validation and Label Encoder
This is my first attempt in defining a keras classifier for multi-class classification, and is done by the Iris Dataset(Most popular for Novie Machine Learning Enthusiasts) on the UCI Machine Learning Repository. Link for data set: http://archive.ics.uci.edu/ml/datasets/Iris
Algorithm:
- Fixed the random seed variable at 10.
- Loaded the dataset from iris.csv and split it into input variables and output variables.
- Did the one hot encoding or created dummy variables from a categorical variable using scikit-learn class LabelEncoder and then we convert the vector of integers to a one hot encoding using the Keras function to_categorical().
- Defined the Neural Network Model(Keras Classifier) {4 input variables -> [4 nodes in hidden layer] -> 3 output variables}
- Evaluated the model using K-Fold Cross Validation and also computed the accuracy of the classifier.
Under update! please be patient