Argmax Equation
Statistics
Portland Data Science Group
Created by Andrew Ferlitsch
Community Outreach Officer
July, 2017
Max Equation
• The max() equation returns the largest value from a set of values.
max( x1, x2, x3, x4, x5 )
x ∈ S
S : Set of Discrete Values
R: Set of Continuous Real Values
∈ : Symbol for Element of a Set
xi : An Instance of an Element of a Set
≥ : Greater than or equal to for all elements in a set
• Condition is met where element xj is the maximum in x ∈ S, when:
xj ≥ xi , x ∈ S
Enumerated set of values (S)
For all x that are elements of set x
xj is greater than or equal to all elements xi in set S
ArgMax Equation
• The argmax() equation returns the largest values (points) that
maximize a function.
argmax( f(x) )
x ∈ S
f(x) : function that takes x as an input
• Condition is met when the output of the function for at least
one element xj that is greater than or equal to the output of
for all x ∈ S.
f(xj) ≥ f(xi), x ∈ S
Which values of x maximize the output of f(x)
For all x that are elements of set x
The output for xj is greater than or equal to the output for all elements xi in set S
Examples:
argmax( x( 10 –x ) ) = 5
x ∈ R
x maybe continuous or discrete
x = 1 -> 1 * 9 = 9
x = 2 -> 2 * 8 = 16
x = 3 -> 3 * 7 = 21
x = 4 -> 4 * 6 = 24
x = 5 -> 5 * 5 = 25
x = 6 -> 6 * 4 = 24
x = 7 -> 7 * 3 = 21
x = 8 -> 8 * 2 = 16
x = 9 -> 1 * 9 = 9
x = 5 maximizes f(x)
argmax( cos(x) ) = { …, -4∏, -2∏, 0 , 2∏, 4∏, … }
x
The maximum values of cos(x) occur at 0 and intervals of 2∏.
Returns a set of values
Examples from Wikipedia
Python – Numpy.Argmax
data = np.array( [ 1, 2, 3 ] )
x = np.argmax( data )
Numpy function to create a numpy arrayValue is: array( [ 1, 2, 3 ] )
import numpy as np
Value is: 3
Numpy function to calculate argmax
Keyword to refer to library by an alias (shortcut) name
data = np.array( [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 0, 2, 3 ] )
x = np.argmax( data )
Numpy function to create a numpy matrix
Value is: 6
Note: numpy.argmax does not evaluate a function for the maximum output, but takes a set (which may have
bBeen generated by a function), and finds the maximum value in the set.

Statistics - ArgMax Equation

  • 1.
    Argmax Equation Statistics Portland DataScience Group Created by Andrew Ferlitsch Community Outreach Officer July, 2017
  • 2.
    Max Equation • Themax() equation returns the largest value from a set of values. max( x1, x2, x3, x4, x5 ) x ∈ S S : Set of Discrete Values R: Set of Continuous Real Values ∈ : Symbol for Element of a Set xi : An Instance of an Element of a Set ≥ : Greater than or equal to for all elements in a set • Condition is met where element xj is the maximum in x ∈ S, when: xj ≥ xi , x ∈ S Enumerated set of values (S) For all x that are elements of set x xj is greater than or equal to all elements xi in set S
  • 3.
    ArgMax Equation • Theargmax() equation returns the largest values (points) that maximize a function. argmax( f(x) ) x ∈ S f(x) : function that takes x as an input • Condition is met when the output of the function for at least one element xj that is greater than or equal to the output of for all x ∈ S. f(xj) ≥ f(xi), x ∈ S Which values of x maximize the output of f(x) For all x that are elements of set x The output for xj is greater than or equal to the output for all elements xi in set S
  • 4.
    Examples: argmax( x( 10–x ) ) = 5 x ∈ R x maybe continuous or discrete x = 1 -> 1 * 9 = 9 x = 2 -> 2 * 8 = 16 x = 3 -> 3 * 7 = 21 x = 4 -> 4 * 6 = 24 x = 5 -> 5 * 5 = 25 x = 6 -> 6 * 4 = 24 x = 7 -> 7 * 3 = 21 x = 8 -> 8 * 2 = 16 x = 9 -> 1 * 9 = 9 x = 5 maximizes f(x) argmax( cos(x) ) = { …, -4∏, -2∏, 0 , 2∏, 4∏, … } x The maximum values of cos(x) occur at 0 and intervals of 2∏. Returns a set of values Examples from Wikipedia
  • 5.
    Python – Numpy.Argmax data= np.array( [ 1, 2, 3 ] ) x = np.argmax( data ) Numpy function to create a numpy arrayValue is: array( [ 1, 2, 3 ] ) import numpy as np Value is: 3 Numpy function to calculate argmax Keyword to refer to library by an alias (shortcut) name data = np.array( [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 0, 2, 3 ] ) x = np.argmax( data ) Numpy function to create a numpy matrix Value is: 6 Note: numpy.argmax does not evaluate a function for the maximum output, but takes a set (which may have bBeen generated by a function), and finds the maximum value in the set.