kmeans
官方:https://www.mathworks.com/help/releases/R2019a/stats/kmeans.html#buefs04-3
参考:https://blog.csdn.net/u010451580/article/details/52249195
输入:
X:输入数据
k:要分几类
Name:其他功能的名字
Value: Name相对需要输入的值
比如距离判断标准要改,那这里要写’Distance’,‘cityblock’(一种距离计算公式)
如果要自定义初始聚类中心,要这样写:
’Start’,A(A里面包含你要输入的聚类中心坐标)
输出:
idx:所有点所属类别的标签
C:每个类的中心
sumd:每个类中的点到其中心的距离和
lssvm
[yp,alpha,b,gam,sig2,model] = lssvm(x,y,type,varargin)
- 输入:
x :N x d, (can be uni- or multivariate) 样本
y: N x 1标签
syntax:
RBF-kernel is used with standard simplex method
yp = lssvm(x,y,‘f’)
lin/poly/RBF is used with standard simplex
yp = lssvm(x,y,‘f’,kernel)
- 输出:
yp : N x 1 vector of predicted outputs
alpha : N x 1 vector of lagrange multipliers of the LS-SVM
b : LS-SVM bias term
gam : tuned regularization constant
sig2 : squared tuned kernel bandwidth
model : object oriented interface of the LS-SVM