pykelihood.kernels.

linear_regression#

linear_regression(x, add_intercept=False, **constraints)#

Linear regression of the columns in the data.

\[y = \beta_0 + \sum_{i=1}^{n} \beta_i x_i\]
Parameters:
  • x (array-like or int) – The number of dimensions (int) or the data the kernel will be computed on. There will be one parameter for each column.

  • add_intercept (bool) – If True, an intercept is added to the result.

  • constraints (dict, optional) – Fixed values for the parameters of the regression. The constraints are given as beta_i=value, where i is the index of the column starting with 1. If x is provided as a dataframe and the second column is named cname, the following constraints are equivalent: beta_2=2, beta_cname=2, cname=2. The parameter beta_0 constrains the value of the intercept if add_intercept is True.

Returns:

The linear sum computed from the input data.

Return type:

float