Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92122

Add a $minMaxScaler window function

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration

      Shorthand:

      $minMaxScaler: <numeric expression>
      

      Or extended:

      $minMaxScaler: {
        input: <numeric expression>,
        min: <constant numeric expression>,
        max: <constant numeric expression>
      }
      

      Using the defaults for min and max (0 and 1 respectively), given a sequence of numbers in the window
      X = x0, x1, … xn, this will calculate:

      minMaxScaler(xi) =(xi -min(X)) / (max(X) -min(X))

      Now adding parameters smin and smax, for the fully general case we get:

      minMaxScaler(xi, smin, smax) =((xi -min(X)) / (max(X) -min(X))*(smax-smin) +smin

      You can see that these new terms just adjust the value between 0 and 1 to be in the domain (smin, smax)

            Assignee:
            joseph.shalabi@mongodb.com Joe Shalabi
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: