Question: C# Program Part 1: Develop code to train/compute a linear classifier with an n+1-dimensional weight vector W such that the classifier predicts that a given

C# Program

Part 1: Develop code to train/compute a linear classifier with an n+1-dimensional weight vector W such that the classifier predicts that a given entity with n-dimensional feature vector F, then letting X=[1,F]T be the augmented feature the input F, belongs the learned category if WX > 0.

You will be given input Training files of the format

Label1 Feat11 Feat12...Feat 1N

Label2 Feat21 Feat22..Feat 2N

.

LabelK FeatK1 FeatK2..Feat KN

And input test files of the form

Feat11 Feat12...Feat 1N

Feat21 Feat22..Feat 2N

.

FeatJ1 FeatJ2..Feat JN

And will output a file with the predicted labels Out1OutJ on one line and the weight vector W on another line.

A training file for points in 2d might be

1 -2 2

0 -2 -3

1 3 2

0 -1 -2

0 0 0

A 2D test file might be

1 1

3 1

-1 -1

3 2

-1 -2

Part one should have code for a dot-product, for testing if an input is correctly classified, for updating the weight vector and for various I/O. This is not super complex; if done compactly it could be < 30lines of code.

Part 2:

Develop code to learn a non-linear MLP non-linear classifier with 3 layers, each of dimension N with binary output.

Train/Test files will be in the same format as part 1.

Your output will be predictions, plus weights for each layer on a separate line, starting with the weights directly applied to the inputs and working forward in the network.

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!