ICP_4 - nimms9/CSEE5590_Python_ICP GitHub Wiki

ICP-4

Name: SUDHEER NIMMAGADDA

Python Lesson-4

Q1. Implement Naive Bayes method using scikit-learn

  • Used the given iris data set and performed cross-validation for training and testing part. And also evaluated the model on testing part.

PROGRAM

https://github.com/nimms9/CSEE5590_Python_ICP/blob/master/ICP_4/Documentation/1_code.JPG

OUTPUT

https://github.com/nimms9/CSEE5590_Python_ICP/blob/master/ICP_4/Documentation/1_output.JPG

Q2. Implement linear SVM method using scikit library

  • Used the same iris data set as above and also used the linear svc classifier on the data set.

PROGRAM

https://github.com/nimms9/CSEE5590_Python_ICP/blob/master/ICP_4/Documentation/2_code.JPG

OUTPUT

https://github.com/nimms9/CSEE5590_Python_ICP/blob/master/ICP_4/Documentation/2_output.JPG

Q3. Compare the results and report accuracy, precision, F-measure and Recall

  • The linear svm classifier is showing accuracy 96.67% and Gaussian Naive Bayes classifier is showing accuracy 93.33%, which means that both the classifiers accuracies are near to each other. So, both the classifiers performed well in terms of accuracy evaluation metric. And the report is as follows:

PROGRAM

https://github.com/nimms9/CSEE5590_Python_ICP/blob/master/ICP_4/Documentation/3_code_1.JPG

https://github.com/nimms9/CSEE5590_Python_ICP/blob/master/ICP_4/Documentation/3_code_2.JPG

OUTPUT

https://github.com/nimms9/CSEE5590_Python_ICP/blob/master/ICP_4/Documentation/3_output.JPG