Documente Academic
Documente Profesional
Documente Cultură
CS-402
NOTE: You must pass the subsequent viva of this assignment to actually have any marks for this assignment.
Page 1 of 3
BSCSHonors Program
CS-402
1. For the following vectors, x x and y y, Write a program that accepts the x and y vectors and calculate the indicated similarity or distance measures. [25]
1) x=(1,1,1,1), y=(2,2,2,2) cosine, correlation, Hamming, Euclidean 2) x=(0,1,0,1), y=(1,0,1,0) cosine, correlation, Hamming, Euclidean, Jaccard, SMC 3) x=(1,1,0,1,01), y=(1,1,1,0,0,1) cosine, correlation, Jaccard, SMC Note: Program only one function for each asked similarity measure which will be enough for each individual vector for each of the above three sub parts.
[25]
timeout
season
coach
game
score
team
ball
lost
pla y
wi n
3 0 0
0 7 1
5 0 0
0 2 0
2 1 1
6 0 2
0 0 2
2 3 0
0 0 3
2 0 0
Note: To find details about cosine based proximity measurement, please refer to Tans book chapter 02 at page number 75. You can reuse the cosine calculation function programmed above in question number 01.
(50 Marks)
Following data contains information about the eye patients who got subscription to use lenses based on their disease age, spectacle and stigma reports. The disease age varies between young, pre-presbyopic, and presbyopic. However spectacle prescription would be myope and hypermetrope. Either a patient can have astigma or not. Use this data for a binary classification problem to find the following measures:
1 2 3 4
Page 2 of 3
BSCSHonors Program
CS-402
5 6 7 8 9
I. II. III. IV. V.
No Yes No Yes No
Compute the GINI and Entropy for the overall collection of the training examples. Compute the GINI index for the Age attribute. Compute the GINI index for the Astigma attribute. Compute the GINI index for the Spectacle attribute. Which attribute is the better one? Age, Astigma or Spectacle?
Note: You may extend it for entropy measurement. (Optional) Note: It is optional for you to do this assignment using C++ or Java programming languages only.
END OF ASSIGNMENT
Page 3 of 3