So Katie, what do you think?
Which ones are the right answers here?
>> The right answers, so the, the ones that do need rescaled features will
be the SVM and the k-means clustering.
>> So both and, support vector machines in, in, in k-means clustering, you're
really trading off one dimension to the other when you calculate the distance.
So take, for example, support vector machines.
And you look at the separation line that maximizes distance.
In there, you calculate a distance.
And that distance calculation, trade-offs one dimension against the other.
So we make one twice as big as the other, it counts for twice as much.
The same is true, coincidentally, for
k-means clustering, where you have a cluster center.
And you compute the distance of the cluster center, to all the data points.
And that distance itself has exactly the same characterization.
If you make one variable twice as big, it's going to count for twice as much.
So, as a result, support vector machines and
k-means both are affected by feature rescaling.
So, Katie, tell me about the decision trees and linear regression.
Why aren't they included?
Decision trees aren't going to give you a diagonal line like that, right?
They're going to give you a series of vertical and horizontal lines.
So there's no trade off.
You just, make a cut in one direction, and then a cut in another.
So, you don't have to worry about what's going on in one dimension,
when you're doing something with the other one.
>> So if you squeeze this area little area over here to half the size,
because you rescale the feature where the image line lies.
Well, it'll lie in a different place but
the separation is chronologically the same as before.
It scales with it,
so there's no trade-off between these two different variables.
And how about, linear regression?
>> Something similar happens in linear regression.
Remember that in linear regression,
each of our features is going to have a coefficient that's associated with it.
And that coefficient and that feature always go together.
What's going on with feature A doesn't effect anything with
the coefficient of feature B.
So they're separated in the same way.
>> In fact, if you were to double the variable scale of one specific variable,
that feature will just become half as big.
And the output would be exactly the same as before.
So it's really interesting to see, and for some algorithms,
rescaling is really a potential if we can use it, for others, don't even bother.
إذًا، ما رأيك يا كاتي؟
ما الإجابات الصحيحة هنا؟
>> الإجابات الصحيحة، الإجابات التي تحتاج إلى ميزات تم تغيير حجمها وستكون
.SVM ومجموعات K-MEANS
>> لذا الإجابة هي كلاهما وأجهزة متجهات الدعم في مجموعات K-MEANS، أنتِ تقومين
.بالفعل بمبادلة بعد واحد بآخر عند حساب المسافة
.فلنأخذ، على سبيل المثال، أجهزة متجهات الدعم
.وأنت تلقين نظرة على الخط الفاصل الذي يزيد المسافة إلى أقصى حد
.وهناك، تحسبين مسافة
.وحساب المسافة هذا، يقوم بمبادلة البُعد مقابل آخر
.لذا نجعل أحدهما ضعف الآخر مرتين، يبلغ الضغف بالضبط
ويسري الأمر نفسه، بشكلٍ متطابق، لمجموعات
.K-MEANSclustering، حيث يوجد لديك مركز المجموعات
.وتقوم بحساب مسافة مركز المجموعات، لجميع نقاط البيانات
.وتتضمن المسافة نفسها السمات نفسها
.إذا جعلت متغيرًا أكبر مرتين، فسيطلب الضعف بالضبط
ونتيجة لذلك، تتأثر أجهزة متجهات الدعم
.وK-MEANS بتغيير حجم الميزة
.لذا أخبريني كاتي عن شجرات القرار والانحدار الخطي
لم هي غير مضمنة؟
لن تمنحك شجرات القرار خطًا قطريًا مثل ذلك، صحيح؟
.ستمنحك سلسلة من الخطوط العمودية والأفقية
.لذا لا توجد مبادلة
.لا تقوم سوى بقطع في اتجاه واحد، ثم قطع في اتجاه آخر
،لذا، لا تقلق بشأن ما الذي سيحدث في بُعد واحد
.عند إجراء شيء ما باستخدام الشيء الآخر
،>> لذا تقوم بضغط هذه المنطقة الصغيرة هنا إلى نصف الحجم
.نظرًا لأنك تقوم بتغيير حجم الميزة التي يكمن فيها سطر الصورة
حسنًا، ستكمن في موضع مختلف
.لكن يكون الفاصل مرتبًا زمنيًا كما سبق
،يتم تغيير حجمها باستخدام الفاصل
.لذا لن تكون هناك مبادلة بين هذين المتغيرين المختلفين
وماذا عن الانحدار الخطي؟
.>> يحدث شيء مماثل في الانحدار الخطي
،تذكر أنه في الانحدار الخطي
.كل ميزة من الميزات ستتضمن معاملاً مقترنًا بها
.ويكون هذا المعامل وهذه الميزة معًا دومًا
ما سيحدث مع الميزة أ لا يؤثر بأي شكل على
.معامل الميزة ب
.لذا يتم فصلهما بنفس الطريقة
،>> وفي الحقيقة، إذا كان يتعين عليك مضاعفة حجم المتغير الخاص بمتغير محدد
.فسيصبح حجم هذه الميزة النصف
.وستكون المخرجات مثل ما سبق بالضبط
،لذا من المثير أن نرى ذلك، وبالنسبة لبعض الخوارزميات
.يعتبر تغيير الحجم ممكنًا بالفعل إذا أمكنك استخدامه، وبالنسبة لخوارزميات أخرى، لا يمثل مصدر قلق
O que você acha, Katie?
Quais respostas estão corretas aqui?
>> As respostas corretas, aquelas que precisam de recursos rescaled serão
SVM e K-MEANS CLUSTERING.
>> Então tanto nas máquinas de vetor de suporte quanto no agrupamento k-means, você
troca uma dimensão pela outra quando calcula a distância.
Vamos usar, por exemplo, máquinas de vetor de suporte.
Você vê a linha de separação que aumenta a distância.
Nela você calcula a distância.
E esse cálculo de distância compensa uma dimensão com a outra.
Criamos uma dimensão duas vezes maior que a outra, contada duas vezes.
O mesmo ocorre, coincidentemente, para
agrupamento K-MEANS, no qual você tem um centro do cluster.
E você calcula a distância do centro do cluster para todos os pontos de dados.
E essa distância tem exatamente a mesma caracterização.
Se você criar uma variável duas vezes maior, ela vai exigir o dobro.
Assim, as máquinas de vetor de suporte e o
K-MEANS são afetados pelo redimensionamento de recurso.
Katie, me fale sobre as árvores de decisão e a regressão linear.
Por que elas não estão incluídas?
As árvores de decisão não vão fornecer uma linha diagonal como essa, certo?
Elas vão fornecer uma série de linhas verticais e horizontais.
Então não há compensação.
Basta fazer um corte em uma direção e um corte em outra.
Você não precisa se preocupar com o que está acontecendo em uma dimensão
quando está fazendo algo em outra.
>> E se você comprimir esta pequena área aqui, para metade do tamanho,
porque redimensiona o recurso onde a linha da imagem está?
Ela ficará em um local diferente, mas
a separação é cronologicamente igual à anterior.
Ela pode ser expandida,
não há compensação entre essas duas variáveis diferentes.
E quanto à regressão linear?
>> Algo semelhante acontece na regressão linear.
Lembre-se de que na regressão linear,
cada um de nossos recursos vai ter um coeficiente associado a ele.
E esse coeficiente e esse recurso sempre ficam juntos.
O que acontece no recurso A não afeta o
coeficiente no recurso B.
Então, eles estão separados da mesma forma.
>> Na verdade, se você dobrou a escala variável de uma variável específica,
esse recurso ficará com metade do tamanho.
E a saída será exatamente igual à anterior.
É muito interessante ver, e para alguns algoritmos,
o redimensionamento realmente tem potencial se pudermos usá-lo, para outros não faz diferença.
Katie 你怎么看的?
那些是正确答案?
需要特征缩放的算法时
SVM 和 K-均值聚类
在支持向量机和 K-均值聚类中
计算距离时 你其实是在利用一个维度与另一个维度进行交换
举个例子 就支持向量机而言
它有一条将距离最大化的分割线
你在这里计算距离
而这个计算就是用一个维度与另一个维度进行交换
如果我们把某一点的增大至其他点的两倍 那么它的数值也会扩大一倍
K-均值聚类也是这样的
你有一个集群中心
然后计算各数据点到集群中心的距离
该距离具有相同的特征
如果你将一个变量扩大一倍 它的数值也会扩大一倍
因此 支持向量机和 K-均值聚类
都会受到特征缩放的影响
Katie 解释一下决策树和线性回归
它们为什么不受影响?
决策树并不会呈现对角线 对吧?
它会呈现出一系列的水平线和垂线
所以不存在两者的交换
它只是在不同的方向上进行切割
在处理某一维度时
我们不需要考虑另一个维度的情况
所以 如果把这个方框缩小一半
也就是对该特征进行缩放
图中线条的位置会有所变化
但分割的顺序是一样的
它是按比例分割的
所以 两个变量之间不存在交换
那线性回归呢?
它的情况相似
在线性回归中
每个特征都有一个相应的系数
这个系数总是与相应的特征同时出现
特征 A 的变化不会影响到
特征 B 的系数
所以它们的分割方式相同
事实上 如果你把某一变量的变比例扩大一倍
它的特征会缩小一半
但它的输出不会有任何变化
这一点非常有趣 对于某些算法
我们可以通过缩放特征来改变结果 但另外一些算法则不会受到影响