L2 Norm

dragoljub
dragoljub New Altair Community Member
edited November 5 in Community Q&A
Is there any way to perform an L2 Norm on feature vectors e.g. normalize the vectors to length 1.

The normalize operator seems to only scale within features not across features.

Thanks,
-Gagi
Tagged:

Answers

  • land
    land New Altair Community Member
    Hi,
    unfortunately this isn't currently possible with a built in operator. If you don't have too many attributes, you might make the calculations with the Generate Attributes operator.
    Why are you going to normalize the complete example this way? The attributes will receive different weights per examples and learning will nearly be impossible.


    Greetings,
      Sebastian
  • dragoljub
    dragoljub New Altair Community Member
    Actually, depending on the learning task the L2 norm can be quite effective. For example say you have a long vector of features and want to check when only a few of many is abnormally different compared to the population trend. When using dot product kernels for example the L2-Norm can allow you to compute the angle between samples rather quickly (dot between normalized vector = cos(theta)). Also there is the added benefit of working with small feature magnitudes that speeds up computations in LibSVM for example. So thats why I'm using it. There are other examples, and I think it will be a great feature to add to the normalization operator.

    -Gagi
    Sebastian Land wrote:

    Hi,
    unfortunately this isn't currently possible with a built in operator. If you don't have too many attributes, you might make the calculations with the Generate Attributes operator.
    Why are you going to normalize the complete example this way? The attributes will receive different weights per examples and learning will nearly be impossible.


    Greetings,
      Sebastian
  • land
    land New Altair Community Member
    Hi,
    I thought about this yesterday evening when driving home and I came to exactly the same conclusion. I've added this on the growing stack of good ideas that are still to implement...

    Greetings,
      Sebastian
  • dragoljub
    dragoljub New Altair Community Member
    Great!  :P