log transform features values

Dear all,

It was not clear to me how I could use the Math Formula Node to calculate Log2 of a number (Logarithm with Base 2) in Knime. Actually there is no Log2 in the node, although you can find the "common" base-10 "Log(x)" . However, you can find the "natural", or base-e, log, denoted as "ln(x)".

Thus, you can use the Math Formula Node to do find Log2, by using the the change-of-base formula (based on "ln"):

logbase(X) = ln(X) / ln(base)

That is (for Log2):

log2(X) = ln(X) / ln(2)

Best,

Rodrigo Panepucci

 

4 Likes