Assignment 10
Due Tuesday by 23:59 Points 26 Submitting a file upload Available Nov 26 at 0:00 - Dec 10 at 23:59 15 days
Groups 10,20,30,40,50,60,70,80,90,100,110,120,130,140,150 Instructions
Follow the instructions in each question carefully.
1. A Jupyter notebook along with output for each cell is expected.
2. Any assignment submitted using other python IDEs are not considered for grading.
3. Use appropriate labels for all visualizations.
4. Upload the output.csv file along with the notebook when required.
Question 1
Spam filtering is an example of document classification task which involves classifying an email / SMS as spam or non-spam (a.k.a. ham).
1. Import the dataset from https://www.kaggle.com/uciml/sms-spam-collection-dataset. (1 point).
2. Split the data into training and testing. (1 point). Use 10-fold cross validation.(1 point)
3. Extract features using TF-IDF and display the features. ( 2 points)
4. Model and train the classifier using GaussianNB, BernoulliNB and MultinomialNB.( 3 points)
5. Evaluate classifiers on Test Data. ( 2 points)
6. Plot the decision boundary, visualize training and test results of all the models (3 points)
Question 2
The following dataset is used to classify the car acceptability into classes: unacceptable, acceptable, good and very good.
1. Import the data dataset from https://archive.ics.uci.edu/ml/machine-learning-databases/car/ (Links to an external site.) (1 points).
2. Extract X as all columns except the last column and Y as last column. (1 points)
3. Visualize the dataset using any two appropriate graphs. (2 points)
4. Visualize the correlation between all the variables of dataset. (1 points)
5. Split the data into training set and testing set. (1 points).Perform 10-fold cross validation (1 point).
6. Train a Logistic regression model for the dataset. (1 points)
7. Compute the accuracy and confusion matrix. (2 points)
8. Plot the decision boundary, visualize training and test results (2 point)
9. Predict and display the class label of a car with following attributes : buying, maint, doors, persons, lug_boot, safety as [vhigh,low,4,more,small,med]. (1 points)