Cheat Sheet

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

02a.

paradigms-knn, Tutorial 01 - The Learning Paradigms, and k-NN


Supervised. In supervised learning, for each instance, we get a correct output.

Unsupervised. In unsupervised learning, we have no outputs (labels) given to us (the task is to


explore and make groupings from the data based solely on the input).

Reinforcement. In reinforcement learning, we get some form of output but it does not
correspond directly to the correct output for each instance. For example, we could get a single
output after a batch of instances is processed (as commonly seen in games, where the eventual
game win/loss outcome is the eventual output of a series of instance moves). For example, as a
Year 1 student, I would like to choose modules that maximize my starting income upon
graduation. If we consider the choice of modules during each of the nominal eight semesters as
a problem instance, this would constitute a reinforcement learning problem. In this final task,
the input might be the historical enrollment records of past students (and possibly their
performance within each module), and the output would be their starting salary. Data is the set
of inputs that correspond to the resultant output.
在强化学习中,我们得到某种形式的输出,但它并不直接对应于每个实例的正确输出。例
如,我们可以在处理一批实例后获得单个输出(正如在游戏中常见的那样,最终的游戏赢
/输结果是一系列实例移动的最终输出)。例如,作为一名一年级学生,我想选择能够最
大化我毕业后起始收入的模块。如果我们将标称八个学期中每个学期的模块选择视为一个
问题实例,这将构成一个强化学习问题。在这个最终任务中,输入可能是过去学生的历史
入学记录(可能还有他们在每个模块中的表现),输出可能是他们的起薪。 数据是对应于
结果输出的一组输入。

k-Nearest Neighbors
https://zhuanlan.zhihu.com/p/71646003
https://en.wikipedia.org/wiki/K-d_tree#Complexity
07b.evaluations, Tutorial 05 Evaluation Metrics
07c.evaluations, 08a.data-processing, 08b.feature-engineering, tutorial-06:

MAE https://www.statology.org/mean-absolute-error-calculator/
MSE https://www.statology.org/mse-calculator/
RMSE https://www.statology.org/rmse-calculator/
MAPE https://www.statology.org/mape-calculator/
SMAPE https://rdrr.io/cran/Metrics/man/smape.html

Feature Selection (Wrapper): Recursive Feature Elimination (RFE)


The graph peaked when only the top 3 features are considered. The score slowly decreases as
additional features are added. This is due to the fact that the latter features do not provide any
further information. It is possible that they are a source of noise, explaining the decrease in the
score as more features are added.

09a.perceptron-neural-networks, 09b.backprop-ama, tutorial-07:


10a.deep-learning-cnn, Tutorial 08 - Deep Learning
feature maps 其实就是一个理论意义上的图片,可能是 512 * 512 * 3,可能是 256 * 256 * 10,就是
长,宽,通道数的意思,但是就是每次经过卷积后的一个结果。
然后每次卷积前会把这个 feature maps(这个图)丢进去,然后用 kernel 扫描,每个 kernel 扫描这
个整个 feature maps(这个图)就会得到一个 2 维的结果,因此这个 kernel 扫描的过程是扫描全部
的通道然后再矩阵相加,所以最后成了 2D 的 256 * 256 * 1 的东西。
然后有 n 个 kernel,例如 10 个,每个 kernel 扫描后的结果叠加一起,就成了 256 * 256 * 10。
不断地重复这个 3d 到 2d 又到 3d 又到 2d 又到 3d 过程。

一个 batch(B)的 shape = B(可取 8, 16, 32, 64 等) X H(图像高度) X W(图像宽度) X C(通道数)

在 CNN 中,图像上堆叠两个卷积层,每个卷积层用的 3X3 kernel 扫描,而不是一个卷积层,用 5X5


kernel 扫描?一个 5X5 kernel 有 25 个参数,两个 3X3 kernels 有 18 个参数(一个 3X3 kernel 有 9 个参
数),因此两个 3X3 kernels 的运算速度更快,而且一个 5X5 kernel 和两个 3X3 kernels 的视野(步长
为 1)是一样的。

You need a model to determine the sentiment of sentences (RNN, CNN)


You need a model to do translation between two languages (RNN)

Tutorial 09 - RNN and XAI


In LIME, we use a predictor which is a quadratic function rather than a line. How do you sample points for
the decision boundary? Show how quadratic LIME can improve over a linear LIME.

What are the disadvantages of using LIME for explanation?


 Finding a proper neighborhood is difficult. For every new region, we may have to find new kernel
widths. 很难找到合适的邻居。 对于每个新区域,我们可能必须找到新的内核宽度。
 Repeating the sampling process can produce different explanations. 重复抽样过程会产生不同
的解释。
 Locally perturbed data may not be realistic. 局部扰动的数据可能不现实。

You might also like