Linear regression gradient

Supported in: Batch

Calculate the linear regression gradient of the right-hand side (output variable) and the left-hand side (input variable).

Expression categories: Aggregate

Declared arguments

  • Left - The independent/input variable.
    Expression<Numeric>
  • Right - The dependent/output variable.
    Expression<Numeric>

Output type: Double

Examples

Example 1: Base case

Argument values:

  • Left: left
  • Right: right

Given input table:

leftright
15
24
33
42
51

Outputs: -1.0


Example 2: Base case

Argument values:

  • Left: left
  • Right: right

Given input table:

leftright
9.02.0
27.02.0
34.02.0
14.02.0
51.02.0

Outputs: 0.0


Example 3: Base case

Argument values:

  • Left: left
  • Right: right

Given input table:

leftright
9.08.0
9.02.0
9.01.0
9.03.0
9.02.0

Outputs: NaN


Example 4: Null case

Argument values:

  • Left: left
  • Right: right

Given input table:

leftright
1.02.0
nullnull
2.01.0

Outputs: -1.0