是基于局部和全局一致性算法对双月数据进行分类
Posted fpga&matlab
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了是基于局部和全局一致性算法对双月数据进行分类相关的知识,希望对你有一定的参考价值。
function test
load 2moons;
Y = produce_labelY(y);
%{
for alpha = 0 : 0.1 : 1.0
for sigma = 1.5 : 0.1 : 2.5;
LGC(x, Y, sigma, alpha);
end
end
%}
%{
for sigma = 0.05 : 0.01 : 0.20
LGC(x, Y, sigma, 0.9);
end
%}
%for alpha = 0.0 : 0.1 : 0.9
%{
for alpha = 0.9 : 0.01 : 0.99
LGC(x, Y, 0.11, alpha);
end
%}
%{
for sigma = 0.05 : 0.005 : 0.09
LGC(x, Y, sigma, 0.99);
end
%}
%{
min_error = 200;
best_s = 0;
best_a = 0;
for sigma = 0 : 0.005 : 0.1
for alpha = 0.9 : 0.01 : 0.99
error_number = LGC(x, Y, -y, sigma, alpha, 0);
if error_number < min_error
min_error = error_number;
best_s = sigma;
best_a = alpha;
end
end
end
error_number = LGC(x, Y, -y, best_s, best_a, 1);
%}
% The last proper parameter tuning
min_error = 200;
best_s = 0;
best_a = 0;
for sigma = 0.07 : 0.001 : 0.08
for alpha = 0.95 : 0.001 : 0.999
%error_number = LGC(x, Y, -y, sigma, alpha, 0, 1);
error_number = LGC(x, Y, -y, sigma, alpha, 0, 0);
if error_number < min_error
min_error = error_number;
best_s = sigma;
best_a = alpha;
end
end
end
error_number = LGC(x, Y, -y, best_s, best_a, 1, 0)
%error_rate = LGC(x, Y, -y, 0.07, 0.996, 1, 0);
function Y = produce_labelY(y)
n = size(y, 1);
Y = zeros(n, 2);
%{
label_number = 40;
index = find(y == 1);
Y( index(find(index <= label_number)), 1) = 1;
index = find(y == -1);
Y( index(find(index <= label_number)), 2) = 1;
%}
Y(53, 1) = 1; %Positive example
Y(143, 2) = 1; %Active exampl
以上是关于是基于局部和全局一致性算法对双月数据进行分类的主要内容,如果未能解决你的问题,请参考以下文章
半监督分类基于K-means和Label+Propagation的半监督网页分类
PointNetPointNet++ 基于深度学习的3D点云分类和分割
PointNetPointNet++ 基于深度学习的3D点云分类和分割
chandy-lamport 分布式一致性快照 算法详细介绍
21.Flink-高级特性-新特性-Exactly-Once数据一致性语义分类如何实现局部的Exactly-Once分布式快照/Checkpoint
21.Flink-高级特性-新特性-Exactly-Once数据一致性语义分类如何实现局部的Exactly-Once分布式快照/Checkpoint