Lab 2 - SASLEENREZA/Python_DeepLearning GitHub Wiki

Team ID: 15

Name : Sasleen Reza Shaik, Class ID : 27

Name : Navya Ramya Sirisha, Class ID : 24

Wiki link :

https://github.com/navyaramyasirisha/PYTHON2018FALL/wiki/lab2

Youtube link : Click me!

Introduction :

This lab assignment deals with various aspects of machine learning. Libraries like Matplotlib, Numpy, Scikitlearn, NLTK etc were used.

Objective :

The principle objective of this assignment is to have a brief exposure various concepts of Python like Classification and regression models, Support vector machines, Natural language processing algorithms, K- nearest neighbours.

Program-1 : Naive Bayes classification

Approach:

For this program, Iris dataset was used. All the required libraries were imported. The dataset was split up into training and test data and Gaussian Naive Bayes function is applied.

Output:

The pairwise scatterplot of the species

The accuracy of the model is displayed.

Program-2 : Support Vector Machine

Approach:

Iris dataset was used in this program and all the required libraries were imported. The dataset is split into training and test data. Now SVM is applied to Poly and RBF kernels. After that, Gamma and C values are changed to find the change in accuracy.

Output:

The accuracy of poly and RBF kernels and after changing the Gamma and C values.

Program-3 : Lemmatization and Bigrams

Approach:

All the required libraries are imported and a test file is taken for NLTK analysis. Now, all the words and sentences are tokenized. Now, lemmatization and n-gram function is applied and conclusions like bigrams with highest word frequency, top five bigrams are found out.

Output:

Summary of the NLTK analysis

Program-4 : K- Nearest Neighbours

Approach:

In this program, digits dataset was used and all the required libraries are imported. The dataset is split into training and test data with the appropriate function. Now, the KNN function with K values 1, 50, 99 in each case is applied to check the accuracy

Output:

The model with K=1 proved to have the best accuracy among others.

Conclusion:

Some of the Applications of Python in Machine Learning & Natural Language Processing that includes its packages and modules were learnt.