Question: Linear classification Assume that we wish to classify a data vector y i n R 2 into two classes. For this purpose, you design two

Linear classification
Assume that we wish to classify a data vector yinR2 into two classes. For this purpose, you design two classifiers, namely linear classifier with least square and logistic regression. The parameters of the classifiers are estimated in a supervised manner using data set given in 'hw2data.txt' file (Fig.1). The data set contains 200 data samples, yn's, and their labels, zn's. Each row in the data file is associated with one data sample. First two columns in the data file correspond to the first and second coordinates of data vector, yn, and the last column corresponds to the label, zn.
Figure 1: Scatter plot of data.
a. First split the entire data set randomly in training and test sets. Allocate the %80 of the data for training and the rest for test.
b. Consider a linear classifier g1(y)=w1Ty with the following classification rule:
z={1,g1(y)00,g1(y)0
Train the classifier with least square (LS) approach using training data.
c. After training classify the test data and calculate the overall accuracy (OA) and F1 score metrics.
d. Consider a logistic regression g(y)=(w2Ty) with the following classification rule:
z={1,g2(y)0.50,g2(y)0.5
To train the classifier write your own gradient descent (GD) algorithm. Choose the initial values as zero. Set the learning rate =0.001 and maximum number of iterations to 100.
e. After training classify the test data and calculate the overall accuracy (OA) and F1 score metrics.
f. List the performance metrics of the classifiers in a table as follows:
\table[[,OA,F1
 Linear classification Assume that we wish to classify a data vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!