Skip to content

Lab_3 Wiki

Bhavya Teja edited this page Oct 10, 2017 · 1 revision

Welcome to the Python-DeepLearning_CS5590 Lab 3 wiki!

The Lab 3 mainly concentrates on the Machine Learning Algorithms in Python.

Task 1:

Task 1 is to implement the Linear Regression model on the dataset. I used a movie dataset for developing a Linear Model. The Model predicts the Gross Income of the Movie by taking the Movie budget as the input.

In this model, the Dependent Variable is Gross Income and the Independent Variable is Movie Budget.

Here is the Screenshot of the Code:

The Visualization of the Training set data:

The Visualization of the Test set data:

Task 2:

The Task 2 is to implement KMeans Clustering on Customers Dataset and divide it into five clusters.

Here is the Screenshot of the code:

The Visualization of the Model after implementing the KMeans Clustering:

Task 3:

The Task 3 is to implement SVM Classification on any of the datasets that are available in scikit-learn. I chose the digits dataset. Initially, we have to perform the Linear SVM Classifier and then rbf SVM classifier.

Here are the Screenshots of the code:

The Accuracies of the Two Models are:

The Accuracy of the Linear kernel SVM is 97.5% whereas the rbf kernel SVM is 97.79%. The difference is not that much but the performance of rbf is more than the linear kernel. The rbf kernel SVM performs well for the non-linear models.

Task 4:

The Task 4 is to take an input text file and perform the Natural Language Processing techniques. The Text file is: Click here to open the text file.

The Following steps are implemented:

-Read the file -Using Lemmatization, apply lemmatization on the remaining words -Using POS, remove all the verbs -Calculate the word frequency of the remaining words -Choose top five words that have been repeated most -Go through the original text that you had in the file -Find all the sentences with those most repeated words -Extract those sentences and concatenate -Enjoy the summarization

Here are the Screenshots of the code:

The output is as follows:

Clone this wiki locally