A small machine learning project in python that helps to classify a flower based on 4 features into one of the three categories(Supervised learning classification) In this project we process our data and then feed them on three famous supervised algorithms mainly Gaussian Naive Bayes, Support Vector machine , Decision tree and everytime after doing some preprocessing on the data we record our observation of the data on each algorithm
In this script we simply load the data from data_set.txt extract our data and then seperate the features from the labels then we split our data in 60:40 ratio for training and testing set respectively and simply feed the data into Support Vector Machine GaussianNB and Decision tree we get the following metrics we sure sklearn.metrics module to get these dataParameter | Support vector Machine | Gaussian Naive Bayes | Decision tree Classifier |
Accuracy_Score | 0.966666666667 | 0.966666666667 | 0.966666666667 |
Precision_Score | 0.96746031746 | 0.966666666667 | 0.984126984127 |
Recall_Score | 0.96746031746 | 0.966666666667 | 0.984126984127 |
In this script we simply load the data from data_set.txt extract our data and then seperate the features from the labels unlike previous step this time we convert our 4 feature data into a 2 feature using PCA and then we visualize our data then we split our data in 60:40 ratio for training and testing set respectively and simply feed the data into Support Vector Machine GaussianNB and Decision tree we get the following metrics we sure sklearn.metrics module to get these data
Parameter | Support vector Machine | Gaussian Naive Bayes | Decision tree Classifier |
Accuracy_Score | 0.966666666667 | 0.916666666667 | 0.966666666667 |
Precision_Score | 0.96746031746 | 0.918253968254 | 0.966666666667 |
Recall_Score | 0.96746031746 | 0.919457735247 | 0.971014492754 |
In this script we simply load the data from data_set.txt extract our data and then seperate the features from the labels unlike previous step this time we convert our 4 feature data into a 2 feature using PCA and then we visualize our data but unlike previous script now we extract the raw data to sepal (first two attributes) apply PCA and convert it to one then we repeat this for petal and this is how we get two features for our training and testing then we split our data in 60:40 ratio for training and testing set respectively and simply feed the data into Support Vector Machine GaussianNB and Decision tree we get the following metrics we sure sklearn.metrics module to get these data
Parameter | Support vector Machine | Gaussian Naive Bayes | Decision tree Classifier |
Accuracy_Score | 0.983333333333 | 0.966666666667 | 0.966666666667 |
Precision_Score | 0.984126984127 | 0.96746031746 | 0.96746031746 |
Recall_Score | 0.984126984127 | 0.96746031746 | 0.96746031746 |