pykelihood.kernels.
polynomial_regression#
- polynomial_regression(x, degree=2, **constraints)#
Polynomial regression in the columns of the data.
\[y = \sum_{i=1}^{n} \sum_{d=1}^{D_i} \beta_{i,d} x_i^d\]- 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.
degree (int or Sequence) – The degree of the polynomial for each covariate. If an integer, the same degree is used for all.
constraints (dict, optional) – Fixed values for the parameters of the regression. The constraints are given as
beta_i_d=value, whereiis the index of the column starting with 1 anddis the degree. If x is provided as a dataframe and the second column is named cname, the following constraints are equivalent:beta_2_2=2,beta_cname_2=2,cname_2=2.
- Returns:
The polynomial regression computed from the input data.
- Return type:
float