The linear_regression function#

Aliases#

halerium.core.regression.linear_regression
linear_regression(name, operands, result_shape, operands_location=None, operands_scale=None, result_location=None, result_scale=None, slope_mean=0, slope_variance=1, intercept_mean=0, intercept_variance=1)#

Creates a regression operation along with parameters.

Parameters:
  • name (str) – The name to be given to the entity containing the regression parameters.

  • operands (list, tuple, set, Operator) – The operand or list of operands of the regression. Can also be a set of operands if neither operands_location nor operands_scale are given.

  • result_shape (tuple) – The shape of the result of the regression.

  • operands_location (optional) – The (list of) location(s) for scaling the operand(s), which will be subtracted from the operand(s). The default is None (no subtraction).

  • operands_scale (optional) – The (list of) scale(s) for scaling the operand(s), which will divide the operand(s) after subtracting any location parameter(s). The default is None (no division).

  • result_location (optional) – The location for unscaling the result. This will be added to the result of the regression (after multiplying by any scale parameter). The default is None (no addition).

  • result_scale (optional) – The scale for unscaling the result. The result of the regression will be multiplied by this. The default is None (no multiplication).

  • slope_mean (float, np.ndarray, Operator) – The prior mean of the slope. The default is 0.

  • slope_variance (float, np.ndarray, Operator) – The prior variance of the slope. The default is 1.

  • intercept_mean (float, np.ndarray, Operator) – The prior mean of the intercept. The default is 0.

  • intercept_variance (float, np.ndarray, Operator) – The prior variance of the intercept. The default is 1.

Returns:

  • result (Operator) – The result of the regression.

  • parameters (Entity) – The parameters of the regression.