我正在尝试将高斯混合模型的轮廓线可视化到我的散点图中,但它们没有正确显示,首先我认为它们与点重叠但是问题仍然存在,即使我先画线然后绘制散点图。
我生成图表的代码:
mn = min(pcaX); mx = max(pcaX);
for i = 1:6
subplot(2,3,i);
gscatter(pcaTest(:,1), pcaTest(:,2), testLabels);
hold on;
ezcontour(@(x,y)pdf(models{i},[x y]), [mn(1) mx(1) mn(2) mx(2)]);
hold off, axis xy, title(['For class ',int2str(i),'components:',int2str(models{i}.NumComponents)]), xlabel('PC1'), ylabel('PC2');
end
它的外观:注意轮廓线的切割