Part 1

“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.”

Machine learning is all about drawing lines through data and we decide what purpose the line services, such as a decision boundary in a classification algorithm, or a predictor that models real-world behavior. And these lines in turn just come from finding the minimum of a cost function using gradient descent.

阅读全文 »

Perhaps you’ve seen some data points and then someone fit a line called the best-fit line to these points; that’s regression.What happens in logistic regression is we have a bunch of data, and with the data we try to build an equation to do classification for us.

Peter HarringtonMachine Learning in Action

Classification with logistic regression and the sigmoid function

  理想函数: 接收所有特征,返回预测类别.

阅读全文 »

Classification

​ 输入一些属性(input sth),经过一个function处理,输出一个结果(output sth);

​ 包括二分类(Credit sorting)或者多分类(Handwritten character recognition,face recognition).

how to do classification?

​ Binary classification as example:

阅读全文 »

过拟合?欠拟合?

​ 一般情况我们把学习器在训练集上的误差称为’训练误差’(training error),在新样本上的误差称为’泛化误差’(generalization error).而机器学习的目的是得到泛化误差小的学习器.

​ 为了得到性能较好的学习器,我们尽可能多地学习适用于所有潜在样本的普遍规律.(考虑得尽可能的多)

​ 然而,当学习器把训练样本学习得’太好’的时候,很有可能把训练样本本身的一些特点当成了所有潜在样本都会有的一般性质.这样的学习器泛化性能下降了,这就是’过拟合’.与之相对的’欠拟合’,指对训练样本的一般性质尚未学好.下图中的 1,3 分别表示了欠拟合和过拟合.

阅读全文 »

昨天的问题解决了 - -

1
2
3
4
5
6
7
>>> i.__iter__()
<listiterator object at 0x7f5f9d3f2310>
>>> i.__iter__()
<listiterator object at 0x7f5f9d3f22d0>
>>> i.__iter__()
<listiterator object at 0x7f5f9d3f2350>

每次调用 ***i._iter_()时总会产生新的iterator对象,这样调用next()***时才会总是输出1.

去麻烦了一下外国朋友,顺便写了写英文 : )

我之前为什么会觉得四次调用是作用在同一个对象上的呢? 尴尬 - -

[http://stackoverflow.com/questions/43487625/what-happend-when-i-assign-an-iterator-to-a-variable]

0%