有人能解释一下数据挖掘中分类和聚类的区别吗?
如果可以,请给出两者的例子以理解主旨。
有人能解释一下数据挖掘中分类和聚类的区别吗?
如果可以,请给出两者的例子以理解主旨。
通常,在分类中,您有一组预定义的类,并希望知道新对象属于哪个类。
聚类尝试将一组对象分组,并发现对象之间是否存在某种关系。
在机器学习的背景下,分类是监督学习,聚类是无监督学习。
也可以看看维基百科上的分类和聚类。
+分类: 给你一些新的数据,你必须为它们设置新的标签。
例如,一家公司希望对其潜在客户进行分类。当一个新客户来的时候,他们必须确定这个客户是否会购买他们的产品。
+集群: 你得到了一组历史交易记录,记录了谁买了什么。
通过使用聚类技术,您可以区分客户的细分。
分类 —预测类别标签 -根据训练集和类标签属性中的值(类标签)对数据进行分类(构造模型) —使用该模型对新数据进行分类
集群:数据对象的集合 —同一集群内彼此相似 —与其他集群中的对象不同
我认为分类是将数据集中的记录分类为预定义的类,甚至是在运行中定义类。我认为这是任何有价值的数据挖掘的先决条件,我喜欢把它看作无监督学习,即在挖掘数据和分类作为一个很好的起点时,一个人不知道他/她在寻找什么
另一端的聚类属于监督学习,即一个人知道要寻找什么参数,它们之间的相关性以及关键水平。我认为这需要对统计学和数学有所了解
聚类的目的是在数据中找到组。“集群”是一个直观的概念,确实如此 没有严格的数学定义。一个集群的成员应该是 彼此相似,而与其他集群的成员不同。一个集群 算法对一个未标记的数据集Z进行操作,并在其上生成一个分区。
对于类和类标签, 类包含相似的对象,而来自不同类的对象 是不同的。有些类具有明确的含义,在最简单的情况下 相互排斥。例如,在签名验证中,签名为任意一种 真的或伪造的。真正的阶级是两者之一,不管我们可能不是 能根据观察到的特定特征正确猜测的。
如果你问过任何数据挖掘或机器学习的人这个问题,他们会使用术语监督学习和无监督学习来解释聚类和分类之间的区别。首先让我解释一下有监督和无监督这两个关键词。
Supervised learning: suppose you have a basket and it is filled with some fresh fruits and your task is to arrange the same type fruits at one place. suppose the fruits are apple,banana,cherry, and grape. so you already know from your previous work that, the shape of each and every fruit so it is easy to arrange the same type of fruits at one place. here your previous work is called as trained data in data mining. so you already learn the things from your trained data, This is because of you have a response variable which says you that if some fruit have so and so features it is grape, like that for each and every fruit.
这种类型的数据将从经过训练的数据中获得。 这种类型的学习被称为监督学习。 这种类型的解决问题属于分类。 所以你已经学会了这些东西,所以你可以自信地工作。
无监督: 假设你有一个篮子,里面装满了一些新鲜的水果,你的任务是把相同类型的水果摆放在一个地方。
这一次你对这些水果一无所知,你是第一次看到这些水果,所以你会如何安排相同类型的水果。
你首先要做的是拿起这个水果然后选择这个水果的任何物理特性。假设你取了颜色。
然后你会根据颜色来排列它们,然后这些组会是这样的。 红色组:苹果和樱桃水果。 绿色组:香蕉和葡萄。 那么现在你将用另一个物理字符作为大小,所以现在群是这样的。 红色和大尺寸:苹果。 红色,体积小,樱桃果状。 绿色,大个头:香蕉。 绿色,体积小,葡萄型。 工作完成了,大团圆结局。
这里你之前什么都没学,意味着没有训练数据和响应变量。 这种类型的学习被称为无监督学习。 聚类属于无监督学习。
分类
是根据从例子中学习,将预定义的类分配给新的观察结果。
这是机器学习的关键任务之一。
聚类(或聚类分析)
尽管被普遍认为是“无监督分类”,但它完全不同。
与许多机器学习者教你的不同,它不是将“类”分配给对象,而是没有预先定义它们。这是做了太多分类的人的有限观点;一个典型的例子,如果你有一个锤子(分类器),所有的东西对你来说都像钉子(分类问题)。但这也是为什么从事分类的人没有掌握聚类的诀窍。
相反,可以将其视为结构发现。聚类的任务是在你的数据中找到你以前不知道的结构(例如组)。如果您学习了一些新的东西,那么群集是成功的。如果你只知道你已经知道的结构,它就失败了。
聚类分析是数据挖掘的关键任务(也是机器学习中的丑小鸭,所以不要相信机器学习者对聚类的否定)。
“无监督学习”有点矛盾
这在文献中反复出现,但无监督学习是该死的。它并不存在,但它就像“军事情报”一样自相矛盾。
算法要么从例子中学习(那么它就是“监督学习”),要么不学习。如果所有的聚类方法都是“学习”,那么计算一个数据集的最小值、最大值和平均值也是“无监督学习”。然后任何计算“学习”它的输出。因此,术语“无监督学习”是完全没有意义的,它意味着一切和什么都不是。
Some "unsupervised learning" algorithms do, however, fall into the optimization category. For example k-means is a least-squares optimization. Such methods are all over statistics, so I don't think we need to label them "unsupervised learning", but instead should continue to call them "optimization problems". It's more precise, and more meaningful. There are plenty of clustering algorithms who do not involve optimization, and who do not fit into machine-learning paradigms well. So stop squeezing them in there under the umbrella "unsupervised learning".
有一些与集群相关的“学习”,但学习的不是程序。用户应该学习关于他的数据集的新东西。
I am sure a number of you have heard about machine learning. A dozen of you might even know what it is. And a couple of you might have worked with machine learning algorithms too. You see where this is going? Not a lot of people are familiar with the technology that will be absolutely essential 5 years from now. Siri is machine learning. Amazon’s Alexa is machine learning. Ad and shopping item recommender systems are machine learning. Let’s try to understand machine learning with a simple analogy of a 2 year old boy. Just for fun, let’s call him Kylo Ren
让我们假设凯洛·伦看到了一头大象。他的大脑会告诉他什么?(记住,即使他是维德的继任者,他也只有最低限度的思考能力)。他的大脑会告诉他,他看到了一个巨大的移动生物,颜色是灰色的。接着他看到一只猫,他的大脑告诉他那是一只会动的金色小动物。最后,他看到了一把光剑,他的大脑告诉他,这是一个无生命的物体,他可以玩!
此时他的大脑知道,军刀不同于大象和猫,因为军刀是用来玩的,不会自己移动。即使凯洛不知道移动是什么意思,他的大脑也能想出这么多。这个简单的现象叫做聚类。
机器学习只不过是这个过程的数学版本。 很多研究统计学的人意识到,他们可以用大脑工作的方式来计算一些方程。 大脑可以聚类相似的物体,大脑可以从错误中学习,大脑可以学习识别事物。
所有这些都可以用统计数据来表示,基于计算机模拟的这一过程被称为机器学习。为什么我们需要基于计算机的模拟?因为计算机比人脑更快地完成繁重的数学运算。 我很想进入机器学习的数学/统计部分,但在没有明确一些概念之前,你不会想直接进入。
Let’s get back to Kylo Ren. Let’s say Kylo picks up the saber and starts playing with it. He accidentally hits a stormtrooper and the stormtrooper gets injured. He doesn’t understand what’s going on and continues playing. Next he hits a cat and the cat gets injured. This time Kylo is sure he has done something bad, and tries to be somewhat careful. But given his bad saber skills, he hits the elephant and is absolutely sure that he is in trouble. He becomes extremely careful thereafter, and only hits his dad on purpose as we saw in Force Awakens!!
从错误中学习的整个过程可以用方程式来模拟,在方程式中,做错事的感觉用错误或代价来表示。这种识别不该用军刀做什么的过程叫做分类。 聚类和分类是机器学习的绝对基础。让我们看看它们之间的区别。
Kylo differentiated between animals and light saber because his brain decided that light sabers cant move by themselves and are therefore, different. The decision was based solely upon the objects present (data) and no external help or advice was provided. In contrast to this, Kylo differentiated the importance of being careful with light saber by first observing what hitting an object can do. The decision wasn’t completely based on the saber, but on what it could do to different objects . In short, there was some help here.
Because of this difference in learning, Clustering is called an unsupervised learning method and Classification is called a supervised learning method. They are very different in the machine learning world, and are often dictated by the kind of data present. Obtaining labelled data (or things that help us learn , like stormtrooper,elephant and cat in Kylo’s case) is often not easy and becomes very complicated when the data to be differentiated is large. On the other hand, learning without labels can have it’s own disadvantages , like not knowing what are the label titles. If Kylo was to learn being careful with the saber without any examples or help, he wouldn’t know what it would do. He would just know that it is not suppose to be done. It’s kind of a lame analogy but you get the point!
We are just getting started with Machine Learning. Classification itself can be classification of continuous numbers or classification of labels. For instance, if Kylo had to classify what each stormtrooper’s height is, there would be a lot of answers because the heights can be 5.0, 5.01, 5.011, etc. But a simple classification like types of light sabers (red,blue.green) would have very limited answers. Infact they can be represented with simple numbers. Red can be 0 , Blue can be 1 and Green can be 2.
如果你懂基础数学,你就知道0、1、2和5.1、5.01、5.011是不同的,分别被称为离散数和连续数。离散数的分类称为逻辑回归,连续数的分类称为回归。 逻辑回归也被称为分类分类,所以当你在其他地方读到这个术语时不要感到困惑
这是关于机器学习的一个非常基础的介绍。我将在下一篇文章中详细讨论统计方面的问题。如果我需要更正,请告诉我:)
第二部分张贴在这里。
There are two definitions in data mining "Supervised" and "Unsupervised". When someone tells the computer, algorithm, code, ... that this thing is like an apple and that thing is like an orange, this is supervised learning and using supervised learning (like tags for each sample in a data set) for classifying the data, you'll get classification. But on the other hand if you let the computer find out what is what and differentiate between features of the given data set, in fact learning unsupervised, for classifying the data set this would be called clustering. In this case data that are fed to the algorithm don't have tags and the algorithm should find out different classes.
聚类是一种对对象进行分组的方法,通过这种方式,具有相似特征的对象聚集在一起,而具有不同特征的对象分开。它是机器学习和数据挖掘中常用的统计数据分析技术。
分类是在训练数据集的基础上识别、区分和理解对象的分类过程。分类是一种有监督的学习技术,其中训练集和正确定义的观察是可用的。
通过聚类,可以用所需的属性(如数量、形状和提取的聚类的其他属性)对数据进行分组。而在分类中,组的数量和形状是固定的。 大多数聚类算法都给出了聚类个数作为参数。然而,有一些方法可以找出合适的集群数量。
摘自《驯象人在行动》一书,我认为它很好地解释了两者的区别:
分类算法与聚类算法(如k-means算法)相关,但仍有很大不同。 分类算法是监督学习的一种形式,与无监督学习相反,无监督学习发生在聚类算法中。 监督学习算法是一种给出包含目标变量期望值的例子。无监督算法不会得到想要的答案,而是必须自己找到一些合理的答案。
机器学习或AI在很大程度上是通过它执行/完成的任务来感知的。
在我看来,通过在任务的概念上思考聚类和分类,可以真正帮助理解两者之间的区别。
聚类是对事物进行分组,分类是给事物贴上标签。
让我们假设你在一个派对大厅里,所有的男人都穿着西装,女人都穿着长袍。
现在,你问你的朋友几个问题:
你好,你能帮我分组吗?
你的朋友可能给出的答案有:
1:他可以根据性别分组,男性或女性
2:他可以根据人的衣服来分组,一个穿西装,一个穿长袍
他可以根据头发的颜色把人分类
他可以把人按年龄分组,等等。
你的朋友有很多方法可以完成这个任务。
当然,你可以通过提供额外的信息来影响他的决策过程,比如:
你能帮我把这些人按性别(或年龄,或头发颜色或衣服等)分组吗?
Q2:
在第二季度之前,你需要做一些准备工作。
你必须教导或通知你的朋友,这样他才能做出明智的决定。假设你对你的朋友说:
留长头发的人是女人。 留短发的人是男人。
Q2。现在,你指着一个长头发的人问你的朋友:这是一个男人还是一个女人?
你能想到的唯一答案是:女人。
当然,聚会上也可以有长发的男人和短发的女人。但是,根据你提供给你朋友的知识,答案是正确的。你可以通过教你的朋友如何区分这两者来进一步改进这个过程。
在上面的例子中,
Q1表示集群完成的任务。
在聚类中,你向算法(你的朋友)提供数据(人),并要求它对数据进行分组。
现在,由算法来决定什么是分组的最佳方式?(性别、肤色或年龄组别)。
同样,你可以通过提供额外的输入来影响算法的决策。
Q2表示分类完成的任务。
在那里,你给你的算法(你的朋友)一些数据(人),称为训练数据,并让他学习哪些数据对应哪个标签(男性或女性)。然后,您将算法指向某些数据,称为测试数据,并要求它确定它是男性还是女性。你的教学越好,预测就越准。
在Q2或Classification中的Pre-work只是训练你的模型,这样它就可以学习如何区分。在聚类或Q1中,这个前期工作是分组的一部分。
希望这能帮助到一些人。
谢谢
分类一行:
将数据分类为预定义的类别
用于集群的一行代码:
将数据分组到一组类别中
关键的区别:
分类是获取数据并将其放入预定义的类别中,而在聚类中,您想将数据分组到的类别集是事先不知道的。
结论:
Classification assigns the category to 1 new item, based on already labeled items while Clustering takes a bunch of unlabeled items and divide them into the categories In Classification, the categories\groups to be divided are known beforehand while in Clustering, the categories\groups to be divided are unknown beforehand In Classification, there are 2 phases – Training phase and then the test phase while in Clustering, there is only 1 phase – dividing of training data in clusters Classification is Supervised Learning while Clustering is Unsupervised Learning
我写了一篇关于同一主题的长文章,你可以在这里找到:
https://neelbhatt40.wordpress.com/2017/11/21/classification-and-clustering-machine-learning-interview-questions-answers-part-i/
分类——数据集可以有不同的组/类。红色,绿色和黑色。分类将试图找到将它们划分为不同类别的规则。
聚类——如果一个数据集没有任何类,而你想把它们放在某个类/分组中,你就可以进行聚类。上面紫色的圆圈。
如果分类规则不好,你就会在测试中出现错误分类,或者你的规则不够正确。 如果聚类不好,你会有很多异常值。不能落在任何集群中的数据点。
首先,像这里的许多回答一样:分类是有监督的学习,聚类是无监督的。这意味着:
Classification needs labeled data so the classifiers can be trained on this data, and after that start classifying new unseen data based on what he knows. Unsupervised learning like clustering does not uses labeled data, and what it actually does is to discover intrinsic structures in the data like groups. Another difference between both techniques (related to the previous one), is the fact that classification is a form of discrete regression problem where the output is a categorical dependent variable. Whereas clustering's output yields a set of subsets called groups. The way to evaluate these two models is also different for the same reason: in classification you often have to check for the precision and recall, things like overfitting and underfitting, etc. Those things will tell you how good is the model. But in clustering you usually need the vision of and expert to interpret what you find, because you don't know what type of structure you have (type of group or cluster). That's why clustering belongs to exploratory data analysis. Finally, i would say that applications are the main difference between both. Classification as the word says, is used to discriminate instances that belong to a class or another, for example a man or a woman, a cat or a dog, etc. Clustering is often used in the diagnosis of medical illness, discovery of patterns, etc.
分类和聚类之间的主要区别是: 分类是借助类标签对数据进行分类的过程。另一方面,聚类类似于分类,但没有预定义的类标签。 分类与监督学习相适应。与此相反,聚类也被称为无监督学习。 分类方法提供训练样本,聚类方法不提供训练数据。
希望这对你有所帮助!
分类:在离散输出中预测结果=>映射输入变量到离散类别
常用用例:
电子邮件分类:垃圾邮件或非垃圾邮件 制裁贷款给客户:是的,如果他有能力支付制裁贷款金额的EMI。不行就不行 癌症肿瘤细胞鉴定:是关键还是非关键? 推文的情感分析:推文是积极的、消极的还是中性的 新闻分类:将新闻分类为预定义的类-政治,体育,健康等
聚类:是对一组对象进行分组,使同一组(称为聚类)中的对象彼此之间(在某种意义上)比其他组(聚类)中的对象更相似。
常用用例:
营销:发现客户细分市场的营销目的 生物学:植物和动物的不同种类的分类 图书馆:根据主题和信息对不同的书籍进行聚类 保险:了解客户、他们的政策并识别欺诈行为 城市规划:将房屋分组,并根据其地理位置和其他因素研究其价值。 地震研究:确定危险区 推荐系统:
引用:
Geeksforgeeks
数据有志者
3叶节点