Machine learning algorithms:
Supervised Learning: Given the “right answer” for each example in the data.
Unsupervised Learning: refers to the problem of trying to find hidden structure in unlabeled data. Since the examples given to the learner are unlabeled, there is no error or reward signal to evaluate a potential solution.
Others:
Reinforcement learning:concerned with how an agent ought to take actions in an environment so as to maximize some notion of cumulative reward
Recommend System
“A computer program is said tolearn from experience E with respect to some task T and some performancemeasure P, if its performance on T, as measured by P, improves with experienceE.”
稍微解释一下 E,T,PSuppose your email program watches whichemails you do or do not mark as spam, and based on that learns how to betterfilter spam. What is the task T in thissetting?
P: The number (or fraction) of emailscorrectly classified as spam/not spam.
E:Watching you label emails as spamor not spam.
T:Classifying emails as spam or notspam.
Linear regression with one variable
Hypothesis:
Cost Function:
Goal:
实验:给定training set (1,1),(2,2), (3,3),观察当theta0 = 0的时候,J(theta0,theta1) 随着 theta1的变化情况
可以发现,J是theta的二次函数,且有全局最小值
实验:给定training set (1,1),(2,2), (3,3),观察J(theta0,theta1) 随着theta0和 theta1的变化情况
Gradient descent
含义为沿着反梯度方向调整theta的值,学习速率为alpha,那么cost function最终会得到最小值。
这里alpha太小会使得学习速率太低,如果alpha太大,又可能无法得到最小值。并且这里,每个theta都是同时进行调整。