Machine Learning, NLP, Data Science, Technology, Productivity.
Frequency(IDF) = log(N/n) = log(4/2) = log(2) TF-IDF value = 1 * log(2) = 0.69314718 Updated vector: [0, 0, 0, 0, 0, 0.69314718, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] The same will get repeated for all other words. However, some libraries may use different methods to calculate this value. For example,