在 matlab 中直观地将数据分为两类
我有两个数据簇,每个簇都有 x,y (坐标)和一个知道其类型的值(1 class1,2 class 2)。我已经绘制了这些数据,但我想用边界(视觉上)分割这些类。做这样的事情的功能是什么。我尝试了轮廓,但没有帮助!
I have two clusters of data each cluster has x,y (coordinates) and a value to know it's type(1 class1,2 class 2).I have plotted these data but i would like to split these classes with boundary(visually). what is the function to do such thing. i tried contour but it did not help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
考虑这个分类问题(使用鸢尾花数据集):
正如您所看到的,除了您事先知道边界方程的易于分离的簇之外,找到边界并不是一项简单的任务...
一个想法是使用 判别分析函数分类以找到边界(您可以在线性和二次边界之间进行选择)。
下面是一个完整的示例来说明该过程。该代码需要统计工具箱:
Consider this classification problem (using the Iris dataset):
As you can see, except for easily separable clusters for which you know the equation of the boundary beforehand, finding the boundary is not a trivial task...
One idea is to use the discriminant analysis function classify to find the boundary (you have a choice between linear and quadratic boundary).
The following is a complete example to illustrate the procedure. The code requires the Statistics Toolbox: