Implementing the (polynomial) "kernel trick" in matlab

6 ビュー (過去 30 日間)
Ashwin Renganathan
Ashwin Renganathan 2017 年 12 月 12 日
編集済み: Ashwin Renganathan 2017 年 12 月 12 日
Given p = 2 vectors x in R^n, y in R^n, how to compute the kernel of order m > 2, which is of the form
A = [ones(n,1), x, y, x.*y, x.^2, y.^2, x.^2 *y, ..., x.^m, y.^m]
q = nchoosek(p+m, m)
A in R^(nxq)
For example, given
x=[1 2]'
y=[2 1]'
m = 3;
Output:
A = [1 1 2 1 4 1 8;1 2 1 4 1 8 1]

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by