Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
774 views
in Technique[技术] by (71.8m points)

matlab - SVM using fitcsvm with custom kernel

I am training a linear SVM classifier with the fitcsvm function in MATLAB using different kernels (with flag 'kernelfunction').

My training set consists of a list of 1x3 vectors, each one of them is labels 1,-1.

At first I was using a regular rbf kernel: exp(-gamma * pdist2(x1,x2)).

Now I want to change the distance function to a geodesic distance, which requires me to have 1x3 data points in the 'kernelfunction'.

Unfortunately, the data points that are transferred to the kernel function are automatically changing to 1x2 so I can't use the required distance function.

Does any one know how can I create a rbf geodesic kernel? I can't find a way to transfer the raw data points to the kernel function.

Thank You.

question from:https://stackoverflow.com/questions/65925148/svm-using-fitcsvm-with-custom-kernel

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...