机器学习速成课程_机器学习速成课程:

机器学习速成课程

Whether you know it or not, machine learning has seeped into every aspect of our lives, now is a critical time for everyone to have a basic understanding in machine learning. This article is designed to not only give you a macro perspective into how machine learning is applied, but to also give you the commonly left out micro perspective into how machine learning works.

你知不知道w ^论是,学习机已经渗透到我们生活的每一个方面,现在是大家都在机器学习的基本理解的关键时刻。 本文的目的不仅是为您提供有关如何应用机器学习的宏观观点,而且还为您提供有关机器学习如何工作的通常被遗忘的微观观点。

机器学习,深度学习和AI有什么区别? (What is the difference between Machine Learning, Deep Learning and AI?)

All of these buzz-words are thrown out all the time and are assumed to be identical in meaning. The reality is quite different.

所有这些流行语一直被扔掉,并被认为在含义上是相同的。 现实是完全不同的。

Image for post
Credit to Andreas Holzinger, Peter Kieseberg, Edgar Weippl & A Min Tjoa 2018. Current Advances, Trends and Challenges of Machine Learning and Knowledge Extraction: From Machine Learning to Explainable AI. Springer Lecture Notes in Computer Science LNCS 11015. Cham: Springer, pp. 1–8, doi:10.1007/978–3–319–99740–7_1.
感谢Andreas Holzinger,Peter Kieseberg,Edgar Weippl和A Min Tjoa2018。机器学习和知识提取的最新进展,趋势和挑战:从机器学习到可解释的AI。 Springer计算机科学LNCS 11015中的讲义。Cham:Springer,第1-8页,doi:10.1007 / 978–3–319–99740–7_1。

This Venn Diagram shows that Deep Learning is a subset of Machine Learning which in turn is a subset of Artificial Intelligence.

该维恩图显示深度学习是机器学习的子集 ,而机器学习又是人工智能的子集

Artificial intelligence is a much broader concept of machines having “intelligence”, as we humans perceive it. Machine Learning is programming an algorithm that adapts with experience. Deep Learning is a subset of Machine Learning which consists of multi-layered Neural Networks. The main focus of this article is Machine Learning, and a special emphasis on Deep Learning.

正如我们人类所感知的那样,人工智能是具有“智能”的机器的更广泛的概念。 机器学习是一种根据经验进行调整的算法。 深度学习是机器学习的一个子集,它由多层神经网络组成。 本文的主要重点是机器学习,特别着重于深度学习。

机器学习到底是什么? (What Exactly is Machine Learning?)

Machine Learning can be split into to two categories: Supervised and Unsupervised learning.

机器学习可以分为两类:监督学习和无监督学习。

Image for post
https://www.extrahop.com/company/blog/2019/supervised-vs-unsupervised-machine-learning-for-network-threat-detection/ https://www.extrahop.com/company/blog/2019/supervised-vs-unsupervised-machine-learning-for-network-threat-detection/

监督下 (Supervised)

Supervised learning is when a model is trained on labelled data: This means clear input data and “solutions” for the data.

监督学习是指在模型上标记的数据上进行训练:这意味着要清除输入数据和该数据的“解决方案”。

Supervised learning can be split into two types: Classification and Regression.

监督学习可以分为两种类型:分类和回归。

Image for post
Credit to : https://whataftercollege.com/machine-learning/classification-of-machine-learning/
归功于: https : //whataftercollege.com/machine-learning/classification-of-machine-learning/

Classification is trying to identify the class that a piece of data belongs to, Regression is drawing a best-fit line in the data that can “catch” as many points as possible.

分类试图识别数据所属的类,回归正在数据中绘制一条最适合的线,可以“捕获”尽可能多的点。

An example of supervised learning is predicting if a human is male or female based on the measurements of the body. There is a clear solution here: the gender of the human.

监督学习的一个例子是根据身体的大小预测一个人是男性还是女性。 这里有一个明确的解决方案:人的性别。

要查看的算法: (Algorithms to look at:)

Adam, RMSprop, Stochastic Gradient Descent

亚当,RMSprop,随机梯度下降

无监督 (Unsupervised)

You can think of Unsupervised learning more of the interpretation of data, or the re-arranging of data to gain valuable insight.

您可以想到无监督学习更多的数据解释,或者重新安排数据以获得有价值的见解。

An example of unsupervised learning is clustering different music listeners together based on music that they’ve listened to. There is no clear solution for the data: it is simply categorising the data to gain insight.

无监督学习的一个示例是根据不同的音乐收听者所听音乐将它们聚集在一起。 对于数据,没有明确的解决方案:它只是对数据进行分类以获得洞察力。

要查看的算法: (Algorithms to look at:)

K-means clustering, Naive Bayes Classifier, Random Forest Classifier

K-均值聚类,朴素贝叶斯分类器,随机森林分类器

神经网络和深度学习简介: (Introduction to Neural Networks and Deep Learning:)

Now that you have a birds-eye view of Machine Learning, Let’s delve deeper into Deep Learning.

既然您已经有了机器学习的鸟瞰图,那么让我们更深入地研究深度学习。

Image for post
Credit to: https://becominghuman.ai/understanding-the-structure-of-neural-networks-1fa5bd17fef0
图片来源: https : //becominghuman.ai/understanding-the-structure-of-neural-networks-1fa5bd17fef0

There are 2 in which to understand Neural Networks: A Layman’s Perspective:

有2种方法可以理解神经网络:Layman的观点:

To put it simply, neural networks are a flexible framework that can be easily altered to change results. You can think of a neural network as a function machine, that takes in a value and gives out an output. All that machine learning algorithms do is to change these values to get the best results possible.

简而言之,神经网络是一个灵活的框架,可以轻松更改以更改结果。 您可以将神经网络视为功能机器,该机器接受一个值并给出输出。 机器学习算法所做的一切就是更改这些值以获得可能的最佳结果。

This perspective retains a macro perspective of what a Neural Network really does, without getting into the nitty gritty mathematical details.

这种观点保留了神经网络实际功能的宏观观点,而无需深入了解具体的数学细节。

数学家的观点: (A Mathematician’s Perspective:)

A neural network is a set of matrices, and to get an output, one must do a set of matrix multiplications to end up with an output value. Machine Learning algorithms are trying to calculate a partial derivative, that explains the relationship between each matrix and the output. By using this partial derivative to alter the matrices, the accuracy of the network can be maximised.

神经网络是一组矩阵,要获得输出,必须进行一组矩阵乘法才能得到输出值。 机器学习算法正在尝试计算偏导数,以解释每个矩阵与输出之间的关系。 通过使用该偏导数来更改矩阵,可以使网络的精度最大化。

迷你数学课: (A mini math lesson:)

(I’ll try to keep this as simple as possible)

(我会尽量保持简单)

Let’s go back to the analogy of the neural network being a function machine. First let’s simplify the neural network down to two connected neurons:

让我们回到神经网络作为功能机器的类比。 首先,我们将神经网络简化为两个相连的神经元:

The mathematical way to describe a neural network is:

描述神经网络的数学方法是:

pred = w*xx = input_data
w = weight
pred = output

This means that the output is calculated by multiplying the input the data, by the variable w. The variable w is the heart of neural networks.

这意味着通过将输入数据乘以变量w来计算输出。 变量w是神经网络的心脏。

衍生产品简介: (Introducing Derivatives:)

Now let’s plot a graph for how the value of y changes, when the value of w changes (assuming x is constant):

现在让我们绘制一个图表,以了解当w的值改变时(假设x为常数)y的值如何变化:

Image for post

Let’s calculate the derivative of the graph:

让我们计算图的导数:

Derivative is just a fancy way of saying, how do you get from the value w to y?

导数只是一种奇特的说法,如何从值w转换为y?

Since pred = w*x,
the derivative of w is x, as you can multiply w by x to get pred.

MSE: (MSE:)

MSE is a calculation of how accurate a line of best fit is:

MSE是对最佳拟合线的准确性的计算:

Image for post
Credit to: https://www.freecodecamp.org/news/machine-learning-mean-squared-error-regression-line-c7dde9a26b93/
感谢: https : //www.freecodecamp.org/news/machine-learning-mean-squared-error-regression-line-c7dde9a26b93/

With a line of best fit, and the set of true points, this is the equation:

用一条最合适的线和一组真点,这是等式:

for every real_point:
mse += (real_point-line_of_best_fit)^2

The MSE is essentially calculating the sum of all the errors and adding them together, for a general understanding of how accurate a line of best fit is.

MSE本质上是计算所有误差的总和并将它们加在一起,以大致了解最佳拟合线的精确度。

计算导数: (Calculating Derivatives:)

The goal of the machine learning algorithm is to get a numerical value of how each weight impacts the overall accuracy of the network, and then change the weight to improve the accuracy.

机器学习算法的目标是获得一个数值,说明每个权重如何影响网络的整体准确性,然后更改权重以提高准确性。

Mathematically speaking, we are looking for the partial derivative of the MSE to the parameter w.

从数学上讲,我们正在寻找MSE对参数w的偏导数。

According to a mathematical theory called the chain rule, to calculate the derivative of a composite function (a nested function), one can multiply the derivatives with respect to each order of the function.

根据称为链规则的数学理论,要计算复合函数(嵌套函数)的导数,可以将导数相对于函数的每个阶乘。

In this case, it means one just has to calculate the rate of change between the MSE and the output value, then the output_value to the parameter y and multiply them together.

在这种情况下,这意味着只需要计算MSE和输出值之间的变化率,然后将output_value转换为参数y并将它们相乘即可。

Since the derivative of x^2 is 2x,
the derivative of the MSE function is 2(real_points-y)We already calculated the derivative of the parameter w to be x.Therefore, the derivative of the MSE function to w is:
x*2(y-pred)

This means for every change in w, the MSE function increases by x*2(y-pred). Since the MSE function is a measure of error, we are trying to find the what value of the parameter w will minimize the MSE function.

这意味着对于w的每一个变化,MSE函数都会增加x * 2(y-pred)。 由于MSE函数是一种误差度量,因此我们试图找到参数w的值将MSE函数最小化。

Without the mathematics standpoint, machine learning would just be a black box, with no rhyme or reason to what they do.

没有数学的观点,机器学习将只是一个黑匣子,没有韵律或理由。

码: (Code:)

Code is obviously a large part of machine learning, but it is very difficult and time consuming to teach a programming language to someone. I will post some annotated python code for you to run if you are interested to delve even deeper into machine learning.

代码显然是机器学习的很大一部分,但是向某人教授编程语言非常困难且耗时。 如果您有兴趣深入研究机器学习,我将发布一些带注释的python代码供您运行。

'''
This is a simple neural network with just one input and one output.
The goal of the network is to change the value of w to be 2, as the true value is 2 and the x_value is 1.
'''x = 1
true_values = 2*x
w = 1
for i in range(100):
pred = w*xmse = (true_values-pred)**2
# derivative of mse and prediction
dmse_dpred = (true_values-pred)*2
dpred_dw = x
# Therefore
dmse_dw = dmse_dpred * dpred_dw
w += dmse_dw*0.1
# This value should be very close to 0, as the accuracy of the network is increasing
print(mse)

应用范围: (Applications:)

After a deep dive into a micro perspective of the math behind machine learning, let’s zoom out and look at the applications of machine learning.

在深入研究了机器学习背后的数学的微观观点之后,让我们缩小范围并研究一下机器学习的应用。

机器学习的工作地点: (Where Machine Learning works:)

Image for post
Credit to: https://www.analyticsinsight.net/10-parameters-for-big-data-assessment/
归功于: https : //www.analyticsinsight.net/10-parameters-for-big-data-assesssment/

When there is plentiful of labelled and doctored data, machine learning performs exceptionally well and usually draws groundbreaking conclusions. For example, machine learning algorithms that have learnt to classify fraudulent or legitimate transactions, after processing the billions of transactions per day, are now online banking’s first line of defense against internet fraudsters.

当有大量经过标记和篡改的数据时,机器学习的表现异常出色,通常可以得出开创性的结论。 例如,在每天处理数十亿笔交易之后,已经学会对欺诈交易或合法交易进行分类的机器学习算法,如今已成为网上银行抵御互联网欺诈者的第一道防线。

在没有的地方: (And Where It Doesn’t:)

Machine Learning Models are very fragile and are not very robust: This means that Machine Learning models do not work for data that is scarce or extremely volatile. An example of this is to diagnose a rare disease: Since the disease does not affect many people, there is little to no data on the disease, making it impossible for the machine learning to gain true insight on the disease.

机器学习模型非常脆弱,并且不够健壮:这意味着机器学习模型不适用于稀缺或极不稳定的数据。 这样的一个例子是诊断一种罕见的疾病:由于该疾病不会影响很多人,因此关于该疾病的数据很少甚至没有,因此机器学习无法获得对该疾病的真知灼见。

结论: (Conclusion:)

From this article, I hope you have learnt an overview of Machine Learning, how it fits into AI, categories of Machine Learning, a basic understanding of the math behind deep learning, and how to apply Machine Learning.

从本文中,我希望您了解了机器学习的概述,它如何适合AI,机器学习的类别,对深度学习背后的数学知识的基本理解以及如何应用机器学习。

Good Luck with your Machine Learning ventures!

祝您在机器学习事业中万事如意!

翻译自: https://medium.com/ai-in-plain-english/a-crash-course-in-machine-learning-8f75ea6a9ed5

机器学习速成课程

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值