Solved-Homework 02: Discrimination by -Regression -Solution

$35.00 $24.00

In this homework, you will implement a discrimination by regression algorithm for multiclass classification in R, Matlab, or Python. Here are the steps you need to follow: 1. Read Section 10.8 from the textbook. 2. You are given a multivariate classification data set, which contains 1000 clothing images of size 28 pixels × 28 pixels…

You’ll get a: . zip file solution

 

 
Categorys:

Description

5/5 – (2 votes)

In this homework, you will implement a discrimination by regression algorithm for multiclass classification in R, Matlab, or Python. Here are the steps you need to follow:

1. Read Section 10.8 from the textbook.

2. You are given a multivariate classification data set, which contains 1000 clothing images of size 28 pixels × 28 pixels (i.e., 784 pixels). These images are from five distinct classes, namely, T-shirt, trouser, dress, sneaker, and bag. The figure below shows five sample figures from each class. You are given two data files:

a. hw02_images.csv: letter images,

b. hw02_labels.csv: corresponding image labels (1: T-shirt, 2: trouser, 3: dress,

4: sneaker, and 5: bag).

3. Divide the data set into two parts by assigning the first 500 images to the training set and the remaining 500 images to the test set.

4. Learn a discrimination by regression algorithm using the sigmoid function for this multiclass classification problem. You can use the following learning parameters.

eta <- 0.0001 epsilon <- 1e-3 max_iteration <- 500
You should initialize the weight parameters to the values given in initial_W.csv and initial_w0.csv files before running your algorithm.

5. Draw the objective function values throughout the iterations. Your figure should be similar to the following figure.

300
250
Error 200
150

100
50
0 100 200 300 400 500
Iteration
6. Calculate the confusion matrix for the data points in your training set using the
discrimination rule you will develop using the estimated parameters. Your confusion
matrix should be similar to the following matrix.

y_predicted y_train 3 4 5
1 2
1 101 2 11 0 1
2 0 79 1 0 0
3 6 5 100 0 1
4 0 0 0 99 2
5 0 0 0 1 91

7. Calculate the confusion matrix for the data points in your test set using the parametric discrimination rule you will develop using the estimated parameters. Your confusion matrix should be similar to the following matrix.

y_predicted y_test 2 3 4 5
1
1 82 1 4 0 2
2 0 87 0 0 0
3 13 3 98 0 3
4 0 0 0 103 1
5 4 0 3 0 96

What to submit: You need to submit your source code in a single file (.R file if you are using R,

.m file if you are using Matlab, or .py file if you are using Python) and a short report explaining
your approach (.doc, .docx, or .pdf file). You will put these two files in a single zip file named as STUDENTID.zip, where STUDENTID should be replaced with your 7-digit student number.

How to submit: Submit the zip file you created to Blackboard. Please follow the exact style mentioned and do not send a zip file named as STUDENTID.zip. Submissions that do not follow these guidelines will not be graded.

Late submission policy: Late submissions will not be graded.

Cheating policy: Very similar submissions will not be graded.