无监督学习 k-means_监督学习-它意味着什么?
無(wú)監(jiān)督學(xué)習(xí) k-means
When we think of a machine, we often think of it in the engineering sense — an actual physical device (with moving parts) that makes some work easier. In machine learning, we use the term machine much more liberally, such as in the support vector machine or the restricted Boltzmann machine — do not worry about these for now. Luckily, none of these machines comes any close to the kind we see in Terminator movies or the Marvel cinematic universe.
當(dāng)我們想到一臺(tái)機(jī)器時(shí),我們通常會(huì)從工程的角度來(lái)考慮它-一種實(shí)際的物理設(shè)備(帶有運(yùn)動(dòng)部件),使某些工作變得容易。 在機(jī)器學(xué)習(xí)中,我們更廣泛地使用機(jī)器一詞,例如在支持向量機(jī)或受限的玻爾茲曼機(jī)器中 -暫時(shí)不用擔(dān)心。 幸運(yùn)的是,這些機(jī)器都不比我們?cè)凇督K結(jié)者》電影或《漫威電影世界》中看到的那種機(jī)器更接近。
Instead, what we refer to as a machine is often an unassuming computer programme that you may feed with some kind of data, and it would, in turn, be able to make some predictions about the future, derive some insights about the past, or take some optimal decisions. Such a computer programme may be stored on your PC or your smartphone, or in the brain of a robot — it really doesn’t matter where — and it’d still be a machine, regardless. The most basic ingredient, however, is data.
取而代之的是,我們所說(shuō)的機(jī)器通常是一個(gè)不帶假設(shè)性的計(jì)算機(jī)程序,您可能會(huì)提供一些數(shù)據(jù),從而可以對(duì)未來(lái)做出一些預(yù)測(cè),對(duì)過(guò)去有所了解,或者做出一些最佳決定。 這樣的計(jì)算機(jī)程序可以存儲(chǔ)在您的PC或智能手機(jī)上,也可以存儲(chǔ)在機(jī)器人的大腦中–并不重要,在任何地方–仍然可以是一臺(tái)機(jī)器 。 但是,最基本的要素是數(shù)據(jù)。
This data could come in many diverse forms: it could be data obtained from a survey or a poll, a physical or chemical experiment, medical records or diagnostics, images of food on the internet, or one’s Facebook posts, really. The data could as well be biometrics such as one’s fingerprints. For example, you may recall when you had a new smartphone and you had to set up fingerprint recognition. You provide the computer programme or machine residing inside the phone your fingerprint data (including those you rotate and deliberately distort); the machine then identifies a pattern in your fingerprint data that distinguishes it from everybody else’s; subsequently, it is able to predict whether any new fingerprint belongs to you or an intruder. This is the stuff of a subfield of machine learning known as semi-supervised learning, which combines elements of supervised and unsupervised learning principles. In this post, we will focus only on supervised learning.
這些數(shù)據(jù)可以有多種形式:可以是從調(diào)查或民意測(cè)驗(yàn),物理或化學(xué)實(shí)驗(yàn),病歷或診斷程序,互聯(lián)網(wǎng)上的食物圖像或Facebook帖子中獲取的數(shù)據(jù)。 數(shù)據(jù)也可以是生物特征,例如一個(gè)人的指紋。 例如,您可能想起了何時(shí)擁有新的智能手機(jī),并且必須設(shè)置指紋識(shí)別。 您向手機(jī)內(nèi)的計(jì)算機(jī)程序或機(jī)器提供指紋數(shù)據(jù)(包括您旋轉(zhuǎn)和故意扭曲的數(shù)據(jù)); 然后, 機(jī)器會(huì)在您的指紋數(shù)據(jù)中識(shí)別出一種模式,以區(qū)別于其他模式; 隨后,它可以預(yù)測(cè)是否有任何新指紋屬于您或入侵者。 這是機(jī)器學(xué)習(xí)稱(chēng)為半監(jiān)督學(xué)習(xí) ,它結(jié)合的監(jiān)督和無(wú)監(jiān)督學(xué)習(xí)原理的元素的子場(chǎng)的東西。 在這篇文章中,我們將只關(guān)注監(jiān)督學(xué)習(xí)。
To think more broadly of supervised learning, it may be useful to imagine this dialogue with a much younger sibling who encounters a dog for the first time on TV.
要更廣泛地考慮監(jiān)督學(xué)習(xí),可以想象一下與第一次在電視上遇到狗的年輕同胞的對(duì)話(huà)。
“What is this?” your sibling asks you, pointing to a group of dogs on the programme.
“這是什么?” 您的兄弟姐妹問(wèn)您,指著該計(jì)劃中的一群狗。
“It’s what we call a dog,” you respond.
您回答:“這就是我們所說(shuō)的狗。”
The innocent child is content, because this is the first time they’re seeing this animal; they can’t disagree with you, at least until one week later when you’re watching the same TV programme again, and they see some cats.
無(wú)辜的孩子很滿(mǎn)足,因?yàn)檫@是他們第一次看到這種動(dòng)物。 他們不會(huì)不同意您的意見(jiàn),至少要等到一個(gè)星期后,當(dāng)您再次觀看同一電視節(jié)目時(shí),他們才會(huì)看到一些貓。
“Look! Here’s a group of small dogs,” they say.
“看! 下面是一組小型犬的,”他們說(shuō)。
“No, those are cats,” you say, smiling, seeing the confusion in their face. Yet, your sibling raises no objections, because they probably reason, not so incorrectly, that a dog is generally large, and a cat is generally small… until the following week when you watch this programme again, and they see a group of puppies.
“不,那是貓。”看到他們的困惑,微笑著說(shuō)。 但是,您的兄弟姐妹沒(méi)有提出異議,因?yàn)樗麄兛赡?不是很錯(cuò)誤地)認(rèn)為狗通常很大,貓通常很小……直到下周您再次觀看此程序時(shí),他們才看到一群小狗。
“Hey look, here’s a group of brown cats,” your young sibling says.
“嘿,看,這是一群棕貓,”你的小兄弟姐妹說(shuō)。
You smile again. “Those are actually dogs, believe it or not,” you say.
你又笑了 您說(shuō):“這些狗實(shí)際上是狗,信不信由你?!?
Now they don’t know if you’re messing with them or not, so they lean in closer toward the TV, and then observe that the dogs have prominent snouts while the cats they saw the week before had more or less flatter faces. That must be it, the child decides.
現(xiàn)在,他們不知道您是否在和他們開(kāi)玩笑,所以他們靠在電視機(jī)前,然后觀察狗的鼻子是突出的,而前一周看到的貓的臉則或多或少地變得平坦。 那一定是,孩子決定。
Several things stand out from this analogy: first, and in fact the main thing that distinguishes supervised learning from other fields of machine learning, is the simple fact that you actually tell your sibling what animal it is, whenever they come across one. This may seem a rather trivial distinction, but consider the contrasting scenario where your sibling didn’t have you around, and they probably end up assuming that the universe is populated with dogs, and that a cat is just a small dog. We refer to this paradigm of machine learning as supervised learning because you essentially act like some kind of teacher or a supervisor who puts a label or an annotation (i.e., “dog” or “cat”) on any new animal (i.e., data) your sibling (who’s acting as our machine) comes across. For this reason, we often refer to the data that is employed in supervised learning settings as labelled or annotated data. In the fingerprint recognition example, what label is used to train the machine to detect an intruder’s prints may not be so obvious. But if one considered it critically, with you giving the machine many examples of your fingerprints, the machine learns to associate your prints to a label which is a binary indicator, i.e., 1 for your fingerprints, and 0 for all other fingerprints it did not see during the setup phase of the phone. This falls under yet another subfield known as anomaly detection, since an intruder’s prints are considered as anomalies to what the machine has come to know.
從這個(gè)類(lèi)比中可以看出幾點(diǎn):首先,事實(shí)上,有監(jiān)督的學(xué)習(xí)與其他機(jī)器學(xué)習(xí)領(lǐng)域之間的區(qū)別是,一個(gè)簡(jiǎn)單的事實(shí),就是當(dāng)兄弟姐妹碰到動(dòng)物時(shí),您實(shí)際上告訴了它是什么動(dòng)物。 這看起來(lái)似乎是微不足道的區(qū)別,但是考慮一下相反的情況,即您的兄弟姐妹沒(méi)有您在附近,而他們最終可能會(huì)假設(shè)宇宙中充滿(mǎn)了狗,而貓只是一只小狗。 我們將這種機(jī)器學(xué)習(xí)范式稱(chēng)為監(jiān)督學(xué)習(xí),因?yàn)槟男袨楸举|(zhì)上就像是在任何新動(dòng)物(即數(shù)據(jù))上貼上標(biāo)簽或注釋(即“狗”或“貓”)的某種老師或主管一樣您的兄弟姐妹(充當(dāng)我們機(jī)器的兄弟姐妹)遇到了。 因此,我們通常將在有監(jiān)督的學(xué)習(xí)設(shè)置中使用的數(shù)據(jù)稱(chēng)為標(biāo)記或注釋數(shù)據(jù)。 在指紋識(shí)別示例中,用來(lái)訓(xùn)練機(jī)器以檢測(cè)入侵者的指紋的標(biāo)簽可能不是那么明顯。 但是,如果認(rèn)為這是關(guān)鍵的是,你給機(jī)器指紋的例子很多, 機(jī)器學(xué)會(huì)了你的指紋,因?yàn)樗鼪](méi)有其他的指紋關(guān)聯(lián)到一個(gè)標(biāo)志 ,是一個(gè)二進(jìn)制值即,1代表你的指紋,和0請(qǐng)參閱手機(jī)的設(shè)置階段。 這屬于另一個(gè)稱(chēng)為“ 異常檢測(cè)”的子領(lǐng)域,因?yàn)槿肭终叩拇蛴”徽J(rèn)為是機(jī)器已知信息的異常 。
The second thing that stands out from the analogy is that the child is never explicitly told precisely what defines a dog or a cat; if they were told, it wouldn’t really be learning, but more like memorising. Instead, they have to figure out themselves by observing the characteristics of the two animals: they identify the size of the animal, as well as the presence of a prominent snout, as being indicative of the target, i.e., whether the animal is a dog or a cat. These things that help in identifying the animal, i.e., the size of the animal and the presence of a prominent snout, are often referred to as features in machine learning. As you may expect, the set of features that are indicative of the target, i.e., the animal being a dog or a cat, are not limited to just those two, but can possibly be quite large. For example, a meticulous child may also observe differences in features such as the lengths of the tails of the two animals, the sizes of their ears or the length of their paws. All these characteristics may constitute the feature set. In machine learning, we think of the set of all features as a vector, and the dimension or size of this vector (which is just the number of features) is referred to as the dimensionality.
從類(lèi)推中脫穎而出的第二件事是,從來(lái)沒(méi)有明確地告訴孩子確切的定義是狗還是貓。 如果被告知,那將不是真正的學(xué)習(xí),而更像是回憶。 相反,他們必須通過(guò)觀察兩只動(dòng)物的特征來(lái)弄清楚自己:他們確定了動(dòng)物的體型以及突出的鼻子的存在,以此作為目標(biāo)的指示,即動(dòng)物是否是狗?;蜇?。 這些東西,在識(shí)別所述動(dòng)物,即幫助,動(dòng)物的大小和一個(gè)突出的口鼻部的存在,常常被稱(chēng)為在機(jī)器學(xué)習(xí)功能 。 如您所料,指示目標(biāo)的一組特征(即,動(dòng)物是狗還是貓)不僅限于這兩個(gè)特征,而且可能很大。 例如,一個(gè)細(xì)心的孩子可能還會(huì)觀察到特征上的差異,例如兩只動(dòng)物的尾巴長(zhǎng)度,耳朵的大小或爪子的長(zhǎng)度。 所有這些特征可以構(gòu)成特征集 。 在機(jī)器學(xué)習(xí)中,我們將所有特征的集合視為一個(gè)向量,并且該向量的維數(shù)或大小(即特征的數(shù)量)稱(chēng)為維數(shù) 。
Eventually, the child learns certain rules on their own — we will later see in subsequent posts exactly how this is done — about these features with which they are able to predict on their own whether a given animal is a dog or a cat. Such a rule might be: if the height of the animal is less than twenty centimetres, and it has no prominent snout, and its tail is at most ten centimetres long, and its ear is at most three centimetres in diameter, then it is a cat; otherwise, it’s a dog.
最終,孩子會(huì)自己學(xué)習(xí)某些規(guī)則-我們稍后將在后續(xù)文章中確切地了解這是如何完成的-有關(guān)這些功能的信息,他們可以自己預(yù)測(cè)給定動(dòng)物是狗還是貓。 這樣的規(guī)則可能是:如果動(dòng)物的身高小于20厘米,并且沒(méi)有明顯的鼻子,并且其尾巴最多10厘米長(zhǎng),耳朵的直徑最多3厘米,那么它就是貓; 否則,它是一只狗。
Learning such rules about the features is usually only the first of three main phases in machine learning, and is known as the training phase; the second phase involves validating how correct the rules learned in the training phase are, and is known as validation; in this validation stage, we test the learned rules on new or unseen data in the hopes of tweaking the rules, if those rules don’t really apply. For example, after your sibling saw the cat, they must have learned a rule like so: “a dog is generally large, while a cat is generally small”. However, upon coming across a small dog, they changed the rules and then included the presence of a prominent snout. This is what happens in the validation phase of machine learning — adjusting the learned rules usually via adjusting certain high-level parameters known as hyperparameters. The third and final phase is known as testing and is very similar to the validation phase, in that the rules learned in the training/validation phases are put to the test again on new or unseen data. However, unlike in the validation phase, there are usually no (or restricted) avenues to tweak the learned rules at this stage, because the rules (which now constitute the machine), are often deployed in a product such as your smartphone or computer system. There are, of course, systems or machines that are designed so that they are capable of constantly training themselves using the data they encounter even during the testing phase.
學(xué)習(xí)有關(guān)這些功能的規(guī)則通常只是機(jī)器學(xué)習(xí)三個(gè)主要階段中的第一個(gè)階段,稱(chēng)為訓(xùn)練階段。 第二階段涉及驗(yàn)證在訓(xùn)練階段學(xué)到的規(guī)則的正確性,稱(chēng)為驗(yàn)證 ; 在此驗(yàn)證階段,我們將在新數(shù)據(jù)或看不見(jiàn)的數(shù)據(jù)上測(cè)試學(xué)習(xí)到的規(guī)則,以期對(duì)規(guī)則進(jìn)行調(diào)整(如果這些規(guī)則并非真正適用的話(huà))。 例如,在您的兄弟姐妹看到貓之后,他們一定學(xué)會(huì)了這樣的規(guī)則:“狗通常很大,而貓通常很小”。 但是,當(dāng)遇到一只小狗時(shí),他們改變了規(guī)則,然后加入了一個(gè)突出的鼻子。 這就是在機(jī)器學(xué)習(xí)的驗(yàn)證階段發(fā)生的事情-通常通過(guò)調(diào)整某些稱(chēng)為“ 超參數(shù)”的高級(jí)參數(shù)來(lái)調(diào)整學(xué)習(xí)的規(guī)則。 第三也是最后一個(gè)階段稱(chēng)為測(cè)試 ,它與驗(yàn)證階段非常相似,因?yàn)樵谟?xùn)練/驗(yàn)證階段中學(xué)習(xí)的規(guī)則將根據(jù)新數(shù)據(jù)或看不見(jiàn)的數(shù)據(jù)再次進(jìn)行測(cè)試。 但是,與驗(yàn)證階段不同,在此階段,通常沒(méi)有(或受限制的)方法來(lái)調(diào)整學(xué)習(xí)的規(guī)則,因?yàn)橐?guī)則(現(xiàn)在構(gòu)成了機(jī)器 )通常部署在智能手機(jī)或計(jì)算機(jī)系統(tǒng)等產(chǎn)品中。 當(dāng)然,有些系統(tǒng)或機(jī)器的設(shè)計(jì)使其即使在測(cè)試階段也能夠使用遇到的數(shù)據(jù)不斷進(jìn)行自我訓(xùn)練。
So far, it may not be obvious what makes supervised machine learning challenging, if all it entails is learning rules from features about some targets. (Recall based on the analogy used that the targets are the labels on the animals, i.e., “dog” or “cat”, and the features are the characteristics of the animals by which we can decide that it is a dog or a cat, i.e., its size, the presence of a prominent snout, etc.) Yet, the peculiarities of many real-world problems for which we wish to employ machine learning are such that: (1) the rules we want to learn from the features about the targets may be rather too complex; (2) the targets and/or features may be noisy; (3) the features on which the rules ought to be based may not even be so obvious to us. I will now describe these specific challenges in a little more detail.
到目前為止,使受監(jiān)督的機(jī)器學(xué)習(xí)更具挑戰(zhàn)性的可能不是很明顯,只要它所需要的就是從某些目標(biāo)的特征中學(xué)習(xí)規(guī)則。 (根據(jù)類(lèi)推,回想一下,目標(biāo)是動(dòng)物的標(biāo)簽,即“狗”或“貓”,特征是動(dòng)物的特征,通過(guò)它們我們可以確定它是狗還是貓,例如,它的大小,突出的鼻子等的存在。)然而,我們希望采用機(jī)器學(xué)習(xí)的許多現(xiàn)實(shí)世界問(wèn)題的特點(diǎn)是:(1)我們想從以下特征中學(xué)習(xí)的規(guī)則:目標(biāo)可能太復(fù)雜了; (2)目標(biāo)和/或功能可能嘈雜; (3)規(guī)則應(yīng)以其為基礎(chǔ)的功能對(duì)我們來(lái)說(shuō)可能并不那么明顯。 我現(xiàn)在將更詳細(xì)地描述這些具體挑戰(zhàn)。
First, recall the rules by which your sibling learned to distinguish a dog from a cat? If the height of the animal is less than twenty centimetres, and it has no prominent snout, and its tail is at most ten centimetres long, and its ear is at most three centimetres in diameter, then it is a cat; otherwise, it’s a dog. This rule uses only four features related to: height, snout, tail and ears. Now imagine you had a million features — yes, that’s a realistic number in some machine learning applications such as computer vision — with which to train a machine that can identify all the objects in your house, then you can very well imagine that the rules about these million features aren’t going to be as trivial as the one we have seen. Just for the avoidance of doubt, these rules are, in fact, mathematical relationships between the features and the targets. Except for simple machine learning problems, these mathematical relationships are rarely simple comparators like “if the height is greater than twenty centimetres, then it is a dog”, but are often ones involving complex operations such as exponentiation of these features.
首先,還記得您的兄弟姐妹學(xué)會(huì)了區(qū)分狗和貓的規(guī)則嗎? 如果動(dòng)物的身高不到20厘米,并且沒(méi)有明顯的鼻子,并且尾巴最長(zhǎng)不超過(guò)10厘米,耳朵直徑不超過(guò)3厘米,則說(shuō)明它是貓; 否則,它是一只狗。 該規(guī)則僅使用與以下四個(gè)特征相關(guān)的特征:身高,鼻子,尾巴和耳朵。 現(xiàn)在,假設(shè)您擁有一百萬(wàn)個(gè)功能-是的,在某些機(jī)器學(xué)習(xí)應(yīng)用程序(例如計(jì)算機(jī)視覺(jué))中,這是一個(gè)現(xiàn)實(shí)的數(shù)字,通過(guò)這些功能訓(xùn)練一臺(tái)可以識(shí)別房屋中所有物體的機(jī)器 ,那么您可以很好地想象一下有關(guān)這100萬(wàn)個(gè)功能不會(huì)像我們所看到的那樣微不足道。 為了避免疑問(wèn),這些規(guī)則實(shí)際上是特征和目標(biāo)之間的數(shù)學(xué)關(guān)系。 除了簡(jiǎn)單的機(jī)器學(xué)習(xí)問(wèn)題外,這些數(shù)學(xué)關(guān)系很少是簡(jiǎn)單的比較器,例如“如果高度大于二十厘米,那么它就是一條狗”,但經(jīng)常涉及復(fù)雜的操作,例如對(duì)這些特征求冪。
It is often joked that the engineer thinks their equations are an approximation to reality, and the physicist that reality is an approximation to their equations, while the mathematician just doesn’t care. In coming up with these complex mathematical relationships between the features and the target for any given problem, our machine often balances a tradeoff between being an engineer and being a mathematician. If we didn’t care that our rules or mathematical relationships are close to our understanding of reality, then we may possibly come up with very accurate relationships. But if we insist on the rules being explainable based on our rough approximation of reality, then this may be at the expense of some loss in accuracy in our machine’s output. This is known as the accuracy-explainability tradeoff.
經(jīng)常開(kāi)玩笑的是,工程師認(rèn)為他們的方程是對(duì)現(xiàn)實(shí)的近似,而物理學(xué)家認(rèn)為現(xiàn)實(shí)是對(duì)方程的近似,而數(shù)學(xué)家根本不在乎。 在針對(duì)任何給定問(wèn)題提出特征與目標(biāo)之間的這些復(fù)雜數(shù)學(xué)關(guān)系時(shí),我們的機(jī)器通常會(huì)在工程師和數(shù)學(xué)家之間進(jìn)行權(quán)衡。 如果我們不在乎我們的規(guī)則或數(shù)學(xué)關(guān)系是否接近我們對(duì)現(xiàn)實(shí)的理解,那么我們可能會(huì)提出非常準(zhǔn)確的關(guān)系。 但是,如果我們堅(jiān)持基于對(duì)現(xiàn)實(shí)的粗略近似就可以解釋這些規(guī)則,那么這可能是以犧牲機(jī)器輸出的準(zhǔn)確性為代價(jià)的。 這稱(chēng)為精度-可解釋性折衷。
Furthermore, in the analogy we used, we have assumed that you always correctly tell your sibling what the right animal is, whenever they encounter it. Thus, your sibling always has the right label or target to reason about the features. In practice, this is hardly the case; the targets can be deliberately or inadvertently flipped. For example, if while watching the TV programme, you were seated quite far from the TV when the puppy came on, your sibling might have shouted, “Is this another cat?” And because you’re probably myopic and couldn’t see the animal quite clearly, you might have simply responded “Yes.” Alternatively, you might have actually seen the puppy quite clearly, but when you shouted back to your sibling: “No, it’s a dog!”, this response got lost in some ongoing conversation in the room, and your sibling heard you as saying, “Yes, it’s a cat!”. Thus, your sibling ends up learning the wrong rules to distinguish a dog from a cat. In this case, we refer to the targets as being noisy, because they are no longer error-free. The features may also be noisy, for example, the image of the cats and dogs your sibling saw on TV might have been distorted or occluded around the snout of a dog. Due to such noisy observations we cannot learn rules that are absolutely correct; we can only be probably approximately correct (PAC), which is a mathematical framework for analysing machine learning methods. There are even worse scenarios where whole noisy inputs are introduced into the machine learning deliberately by adversaries with malicious intents. For example, the machine in a self-driving car was fooled by adversarial inputs to drive 50 mph over the speed limit. This has led to research into what’s referred to as adversarial machine learning, dealing with how to simulate and detect adversarial examples.
此外,在我們所使用的類(lèi)比中,我們假設(shè)您總是在正確的時(shí)候告訴您的兄弟姐妹什么是對(duì)的動(dòng)物。 因此,您的兄弟姐妹始終具有正確的標(biāo)簽或目標(biāo)來(lái)推理特征。 實(shí)際上,情況并非如此。 可以故意或無(wú)意地翻轉(zhuǎn)目標(biāo)。 例如,如果在看電視節(jié)目的時(shí)候,當(dāng)小狗來(lái)時(shí)您坐在電視旁邊很遠(yuǎn)的地方,您的兄弟姐妹可能會(huì)喊道:“這是另一只貓嗎?” 而且,由于您可能是近視者,而且看不清動(dòng)物的身影,因此您可能只是回答“是”。 或者,您實(shí)際上可能已經(jīng)很清楚地看到了這只小狗,但是當(dāng)您對(duì)同胞大喊:“不,那是一條狗!”時(shí),在房間里正在進(jìn)行的對(duì)話(huà)中,這種回應(yīng)就消失了,同胞聽(tīng)到了您的聲音, “是的,它是只貓!” 因此,您的兄弟姐妹最終學(xué)習(xí)了錯(cuò)誤的規(guī)則以區(qū)分狗和貓。 在這種情況下,我們將目標(biāo)稱(chēng)為“ 嘈雜” ,因?yàn)樗鼈儾辉贈(zèng)]有錯(cuò)誤。 這些功能也可能很吵,例如,您的兄弟姐妹在電視上看到的貓和狗的圖像可能在狗的鼻子周?chē)冃位虮徽趽趿恕?由于這種嘈雜的觀察,我們無(wú)法學(xué)習(xí)絕對(duì)正確的規(guī)則; 我們大概只能是近似正確的 (PAC),這是一種用于分析機(jī)器學(xué)習(xí)方法的數(shù)學(xué)框架。 在更糟糕的情況下,具有惡意意圖的對(duì)手會(huì)故意將整個(gè)嘈雜的輸入引入機(jī)器學(xué)習(xí)。 例如,無(wú)人駕駛汽車(chē)欺騙了自動(dòng)駕駛汽車(chē)中的機(jī)器 ,使其以超過(guò)每小時(shí)50英里的速度行駛。 這導(dǎo)致對(duì)所謂的對(duì)抗機(jī)器學(xué)習(xí)的研究 ,涉及如何模擬和檢測(cè)對(duì)抗示例。
Finally, in our analogy, we have made a very fundamental assumption that the child easily picks up on the relevant features by which to distinguish a cat from a dog: first, they consider the sizes of the animals — supposing that a dog is large and a cat is small — and when presented with a small dog, they adjusted the rules and considered features such as the presence of a prominent snout. While this astuteness may come easily to humans, this is not the case with machines. If we were to replace the child in our analogy with our machine, and then present it with pictures of dogs and cats, the machine would not easily know to focus on the sizes of the animals or the presence of prominent snouts or whiskers as features from the image pixels. It could, in fact, consider as features the number of legs of the animals — which obviously is irrelevant — if there was an object obstructing one of the dog’s legs in at least one of the images! In contrast, a human child might not be easily fooled by that.
最后,以類(lèi)推的方式,我們做出了一個(gè)非?;镜募僭O(shè),即孩子很容易掌握將貓和狗區(qū)分開(kāi)的相關(guān)特征:首先,他們考慮了動(dòng)物的體型-假設(shè)狗很大,而且一只貓很小-當(dāng)和一只小狗一起出現(xiàn)時(shí),他們調(diào)整了規(guī)則并考慮了諸如突出的鼻子之類(lèi)的特征。 盡管這種敏銳度對(duì)人來(lái)說(shuō)很容易,但是機(jī)器卻不是這種情況。 如果我們要用機(jī)器代替類(lèi)比中的孩子,然后用狗和貓的圖片展示它,那么機(jī)器就不容易知道專(zhuān)注于動(dòng)物的大小或突出的鼻子或胡須等特征。圖像像素。 實(shí)際上,如果至少有一張圖像中有物體擋住了一只狗的一只腿,那么它可以考慮將動(dòng)物的腿的數(shù)量作為特征,這顯然是無(wú)關(guān)緊要的! 相比之下,人類(lèi)孩子可能不會(huì)因此而輕易被愚弄。
Thus, one painstaking step in classical machine learning is what we refer to as feature engineering or feature extraction. Basically, we need to tell the machine what features it needs to look out for; the machine may then hopefully come up with relevant rules about these features. For example, in order to train a machine to distinguish between people who identify as males or females from pictures, we may need to specify certain distances in the face, such as the separation between the eyes, the width of the nose and the location of the centres and corners of the eyes as features to the machine. In other words, we have to extract these features from the images for the machine, and sometimes we have to engineer others; for example, we might take the ratio of the x- and y-coordinates of the centres of the eyes, or the logarithm of the separation between the eyes.
因此,經(jīng)典機(jī)器學(xué)習(xí)中的一個(gè)艱辛步驟就是我們所說(shuō)的特征工程或特征提取 。 基本上,我們需要告訴機(jī)器它需要尋找什么功能。 然后,機(jī)器可能希望提出有關(guān)這些功能的相關(guān)規(guī)則。 例如,為了訓(xùn)練機(jī)器來(lái)從圖片中識(shí)別出是男性還是女性,我們可能需要指定面部的特定距離,例如眼睛之間的距離,鼻子的寬度和位置。眼睛的中心和角是機(jī)器的特征 。 換句話(huà)說(shuō),我們必須從機(jī)器圖像中提取這些特征,有時(shí)還需要設(shè)計(jì)其他特征。 例如,我們可以取眼睛中心的x坐標(biāo)和y坐標(biāo)的比值,或兩眼間距離的對(duì)數(shù)。
Yet, even when we extract features, we do not even know the optimal number of features to select. If they are too few, we may lose certain information necessary to build accurate rules about the problem, and if they are too many, certain problems could arise, among them the so-called curse of dimensionality and the ever-present issue of overfitting which we would certainly devote another post to discuss. For example, in our analogy, while having more features than “size” alone can arguably help us develop more accurate rules to distinguish a dog from a cat, when the features become too many, a lot of it — such as the colour of the eyes or the number of limbs — may be irrelevant, and we may face the risk of overdoing or overfitting it.
但是,即使提取特征,我們也不知道要選擇的最佳特征數(shù)。 如果它們太少,我們可能會(huì)丟失某些必要的信息以建立關(guān)于該問(wèn)題的準(zhǔn)確規(guī)則;如果它們太多,則可能會(huì)出現(xiàn)某些問(wèn)題,其中包括所謂的維數(shù)詛咒和永遠(yuǎn)存在的過(guò)擬合問(wèn)題。我們當(dāng)然會(huì)另辟一席討論。 例如,以我們的類(lèi)比來(lái)說(shuō),雖然功能本身比“大小”更多,可以說(shuō)可以幫助我們制定更準(zhǔn)確的規(guī)則以區(qū)分狗和貓,但是當(dāng)這些功能變得太多時(shí),其中的很多功能(例如眼睛或四肢的數(shù)量-可能無(wú)關(guān)緊要,我們可能面臨過(guò)度或過(guò)度安裝的風(fēng)險(xiǎn)。
Rather than engineer or extract features, one of the utilities of the subfield of machine learning known as deep learning is to have the machine learn the features and then learn the rules about those features. While this promises to resolve the issue about feature engineering, we will later see the unique challenges deep learning itself presents.
而不是設(shè)計(jì)或提取特征,機(jī)器學(xué)習(xí)子領(lǐng)域的一種實(shí)用程序(稱(chēng)為深度學(xué)習(xí))是讓機(jī)器學(xué)習(xí)特征,然后學(xué)習(xí)有關(guān)這些特征的規(guī)則。 盡管這有望解決有關(guān)功能工程的問(wèn)題,但我們稍后將看到深度學(xué)習(xí)本身所面臨的獨(dú)特挑戰(zhàn)。
翻譯自: https://medium.com/ai-in-plain-english/supervised-learning-what-does-it-entail-e7e265ea7868
無(wú)監(jiān)督學(xué)習(xí) k-means
總結(jié)
以上是生活随笔為你收集整理的无监督学习 k-means_监督学习-它意味着什么?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 双帆电瓶是杂牌子吗
- 下一篇: logistic 回归_具有Logist