seperateclusters.m

来自「这个是支持向量聚类机用matlab编译的主程序和部分子程序」· M 代码 · 共 49 行

M
49
字号
%=====================================================================
%
%   SeperateClusters%   ----------------%%   Parameters:   %		Samples         - The matrix holds the data points.
%		beta 	        - The vector of the Lagrangian multipliers.
%		quad	        - The quadratic part of the distace from the sphere's
%					      center.
%		R		        - The minimal sphere's radius.
%       q		        - The width of the gaussian kernel.%       classification  - The apriori classifications for each Data point.
%
%	Return Value:
%		clusters_assignments -
%		        A vector of the clusters assignments assigned by the algorithm 
%		        to the data points.
%       maj_class - The classifications assigned by the algorithm to each point.%       mis_class - The number of errors of the assigned classification against %                   the apriori classifications.%       nof_samples_per_class_per_cluster%
%	The sphere is mapped back to data space, where it forms a set 
%	of contours which enclose the data points.
%	These contours are interpeted as clusters boundaries. 
%
%=====================================================================

function [clusters_assignments,maj_class, mis_class,nof_samples_per_class_per_cluster] =...                            SeperateClusters(Samples,beta,quad,R,q,classifications);[attr,N] = size(Samples);% calculates the adjacent matrixadjacent_matrix = FindAdjMatrix(Samples,N,beta,quad,R,q);
% Finds the cluster assignment of each data point clusters_assignments = FindConnectedComponents(adjacent_matrix,N);% end clocktoc% finds the classification of each cluster according to the majority.[maj_class, mis_class,nof_samples_per_class_per_cluster] = Classify(classifications, clusters_assignments);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?