Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMP5122M Data Science

Similarity practical

Euclidean similarity

The following dataset has three variables. Calculate the similarity of Record A to each of the other records.

Record

Measurement_1

Measurement_2

Measurement_3

A

0

5

9

B

0

6

9

C

1

9

0

D

9

0

2

Answers:

A - B = 1.00

A - C = 9.90

A - D = 12.45

Manhattan distance similarity

Using the previous question’s dataset, calculate the similarity of Record A to each of the other records.

Record

Measurement_1

Measurement_2

Measurement_3

A

0

5

9

B

0

6

9

C

1

9

0

D

9

0

2

Answers:

A - B 1.00

A - C 14.00

A - D 21.00

Euclidean similarity

The following dataset has three variables. Calculate the similarity of Record A to each of the other records.

Record

Measurement_1

Measurement_2

Measurement_3

A

0

5

9

B

0

6

9

C

1

0

9

D

100

0

2

Answers:

A - B 0.17

A - C 0.83

A - D 1.64

Euclidean similarity

The following dataset has three variables. Calculate the similarity of Record A to each of the other records.

Record

Measurement_1

Categorical_2

Categorical_3

A

0

1

1

B

1

2

2

C

4

2

3

D

9

1

4

Answers:

A - B 1.42

A - C 1.48

A - D 1.41