# Course's Note and Tutorial
*"Machine Learning"*
oleh Andrew Ng, Stanford University
**Week 1**
* Machine learning examples: Web search, photo tagging, email anti-spam, database mining, self-customizing programs.
* AI -> learning algorithm
* Machine learning
* Algorithm:
* Supervised learning -> Given correct data so the algorithm can learn
* Classification -> discrete valued data (few differences)
* Regression -> predict continuous valued output
* Unsupervised learning -> Given data but we didn’t know which one is correct so the algorithm choose the best, which is the most dominant or similar (clustered relationship within data).
* Model Representation
* Linear regressions

* Cost Functions -> measure the accuracy of our hypothesis function

Training data set is scattered on the x-y plane. Try to make a straight line (defined by hθ(x)) which passes through these scattered data points.

Ideal situation where cost function of 0
When θ1=1, we get a slope of 1 which goes through every single data point in our model
Try to minimize the cost function. In this case, θ1=1 is our global minimum.
Our objective is to find or make the software to determine which theta 0 and theta 1 is best.
* Gradient descent

Fungsi derivative -> memperkecil atau memperbesar theta 1 untuk mendekati nilai minimum

Nilai learning rate (alpha)

Gradient descent can converge to local minimum, even with the learning rate fixed


The point of all this is that if we start with a guess for our hypothesis and then repeatedly apply these gradient descent equations, our hypothesis will become more and more accurate.
Gradient descent can be susceptible to local minima in general, the optimization problem we have posed here for linear regression has only one global, and no other local, optima; thus gradient descent always converges (assuming the learning rate α is not too large) to the global minimum
* Matrix and Vector (Matlab Tutorial)






* ...