github 不支持 LaTeX 公式,然而我懒得去使用一些别的方式去支持,可以通过安装 chrome 插件解决
A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.
一个程序被认为能从经验 E 中学习,解决任务 T,达到性能度量 P。当且仅当有了经验 E 之后,经过 P 的评判,程序在处理 T 的时候性能有所提升。
- 监督学习(supervised learning)
- 无监督学习(unsupervised learning)
we are giving a data set and already know what our correct should look like, having the idea that there is a relationship between the input and the output.
意指给出一个实验法,需要部分数据集已经有正确的答案,算法的结果是算出更多正确的数据。
symbol | meaning |
---|---|
m | Number of training expamples |
x‘s | "input" variable / feature |
y's | "output" variable / "target" variable |
(x, y) | one training example(one row in dataset) |
(x(i), y(i)) | ith training expample(i just the index) |
(x(i), y(i)); i = i,... m | a training set |
X | the space of input values |
Y | the space of output values |
θi's | (Model)Parameters |
superscript "(i)" in the notation is simply an index into the training set, and has nothing to do with exponentiation.
To describe the supervised learning problem slightly more formally, our goal is, given a training set, to learn a function h
: X —> Y
, so that h(x)
is a "good" predictor for the corresponding(相符的) value of y
. For historical reasons, this function h
is called a hypothesis. Seen pictorially(用图表表示), the process is therefore like this:
Note: 单变量线性回归模型(univariate linear regression model) is a simplest model.
we are trying to predict results within a continuous(连续的) output, meaning that we are trying to map input variables to some continuous function.
we are instead trying to predict results in a discreate output we are trying to map input variables into discrete categories.
Training Set:
Size of feets2(x) | Price in 1000's(y) |
---|---|
2014 | 460 |
1416 | 232 |
1534 | 315 |
852 | 178 |
´ total M = 47
Parameters:
Hypothesis:
Cost Function(Squared error cost fucntion): measure the accuracy(准确性) of our hypothesis function
Gradient descent alorithm:
repeat until convergence {
}
Unsuprvised learning allows us to approach problems with little or no idea what our results should look like. We can derive(推导) structure from data where we don't necessery know the effect of the varibles.
We can derive strcture by clustering(聚类) the data baseed on relationships among the viribles in the data.
Symbol | Meaning |
---|---|
n | number of features |
input (features) of |
|
value of feature j in |
Hypothesis:
Cost Function:
Gradient descent alorithm:
repeat until convergence {
(simultaneously update
}
pinv(X'*X)*X'*y
$ (h_{\Theta}(x)\in\mathbb{R}) $
$ (h_{\Theta(x)})_i = i^{th} $ output
$$ J({\Theta}) = -\frac{1}{m}\left[\sum_{i=1}^{m}\sum_{k=1}^{K}y^{(i)}{k}log(h{\Theta}(x^{(i)}))k + (1 - y^{(i)}k)log(1-(h{\Theta}(x^{(i)}))k)\right] + \frac{\lambda}{2m}\sum{l=1}^{L-1}\sum{i=1}^{s_l}\sum_{j=1}^{s_l+1}({\Theta}_{ji}^{(i)})^{2} $$