# Calculate inverse document frequency

Im am following this excellent tutorial to get a better grasp on the concept of tv-idf: http://blog.christianperone.com/2011/10/machine-learning-text-feature-extraction-tf-idf-part-ii/

Everything is clear till the final part where this data has to be normalized;

Mtf-idf = [(0,0), (0.41,0.81), (0.41, 0.41), (0,0)]


Mtf-idf = Mtf-idf/Mtfidf||2 = [(0,0), (0,71, 0.89), (0.71, 0.45), (0,0)]


Could anybody explain to me in plain English what is happening here?

• What do you mean by this should lead to? are you asking how to perform the normalization? or why do you get different results? what is the question? Commented Jan 17, 2017 at 12:02

It normalizing row as it said in text , it means sum of squares of rows must be 1 , so :
(0)^2 + (-0.41)^2 + (-0.41)^2 + (0)^2 = 0.34
to normalize the sum these numbers must be 1 so we calculate sqrt(1/0.34) = 1.71 then we multiple this coefficient to all rows ->
0 , -0.41*1.71 = -0.70, -0.41*1.71 = -0.70, 0
for second row -> sqrt(1/0.84)=1.09
0, 1.09*0.81 = -0.88, -0.41*1.09 = -0.45, 0