Normalizing the sample

Report a typo

Suppose you have the following sample from the dataset:

[1,0,9,5,20][1, \, 0, \, -9, \, 5, \, 20]

Perform the row normalization (use the L2L^2 norm). The answer should be the sum of 2 values: the minimum and the maximum of the transformed sample, rounded up to the first decimal. During intermediary calculations, round the L2L_2 norm up to the first decimal, and then round the results of the sample division by the norm up to the first decimal.

As a reminder, to perform the row normalization, you have to calculate the L2L_2 norm of the sample:

x2=i=1nxi2\lVert x \rVert_{2} = \sqrt{ \sum_{i=1}^nx_i^2}

Then, each element in the sample is divided by the obtained norm.

The sample as a Python list
sample = [1, 0, -9, 5, 20]
Enter a number
___

Create a free account to access the full topic