Skip to contents

Formula: K(x_i, x_j) = (gamma * x_i'x_j + a)^d

Usage

Polykern(X, degree = 2, gamma = NULL, coef0 = 1, Z = NULL)

Arguments

X

One record per row.

degree

Polynomial degree d.

gamma

Scale on the inner product; None uses 1/p.

coef0

Constant a added before raising to the power d.

Z

Second set of records; None gives the square Gram matrix of X.

Value

List with K, degree, gamma, coef0, n, m.

References

Montesinos Lopez, Montesinos Lopez and Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, doi:10.1007/978-3-030-89010-0. Chapter 8, Sect. 8.2.2 pp. 255-256 and the worked degree-2 example on p. 256, where the polynomial kernel of degree d with constant a is (gamma x_i'x_j + a)^d and the feature-space dimension is discussed on p. 261. Read from the chapter PDF, not recalled.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Polykern(V)
#> $K
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,]    4    9   16   25   36   49   64   81
#> [2,]    9   25   49   81  121  169  225  289
#> [3,]   16   49  100  169  256  361  484  625
#> [4,]   25   81  169  289  441  625  841 1089
#> [5,]   36  121  256  441  676  961 1296 1681
#> [6,]   49  169  361  625  961 1369 1849 2401
#> [7,]   64  225  484  841 1296 1849 2500 3249
#> [8,]   81  289  625 1089 1681 2401 3249 4225
#> 
#> $degree
#> [1] 2
#> 
#> $gamma
#> [1] 1
#> 
#> $coef0
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $m
#> [1] 8
#> 
#> $method
#> [1] "Polynomial kernel, MVSML Sect. 8.2.2"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"