我试图将高斯混合模型的轮廓线可视化到我的散点图,但它们没有正确显示,首先我认为它们被点重叠,但即使我先画线然后绘制散点,问题仍然存在。
我生成图的代码:
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
这就是它的外观:注意轮廓线的切割