Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

What is Larmors formula? Explain with a suitable example.

Answered: 1 week ago

Question

11.1 Explain the strategic importance of total rewards.

Answered: 1 week ago

Question

11.3 Define pay equity and explain its importance today.

Answered: 1 week ago