Machine Learning is the field of study that gives computer the ability to learn without being explicitly programmed. A computer program is said to learn from experience E with respect ot some task T and some performance measure P, if its performance on T , as measured by P, improves with experience E.
Machine Learning Algorithms:
- Supervised Learning
- Regression (continuous output)
- Classification (discrete valued output)
- Unsupervised Learning
Linear Regression
Linear Regression with one variable
Hypothesis:hθ(x)=θ0+θ1x
Parameters:θ0,θ1
Costfunction:J(θ0,θ1)=2m1i=1∑m(hθ(xi)−yi)2
Goal:Minimize:J(θ0,θ1)
Gradient descent
Repeat until covergence
θj:=θj−α∂θj∂J(θ0,θ1) (for j=0 and 1)
θ0:=θ0−αm1i=1∑m(hθ(xi)−yi)
θ1:=θ1−αm1i=1∑m(hθ(xi)−yi)xi
Linear Regression with multiple variable
Hypothesis:hθ=θTx=θ0x0+θ1x1+...θnxn
Parameters:θ=[θ0,θ1,θ2,..θn]T
Costfunction:J(θ)=2m1i=1∑m(hθ(xi)−yi)2
Gradient descent
Repeat until convergence
θj:=θj−α∂θj∂J(θ) (simultaneously update for every j=0,1,2...n)
θj:=θj−αm1i=1∑m(hθ(xi)−yi)xj
Method to solve of θ analytically : Normal Equation
Let hθ=θTx=θ0x0+θ1x1+...θnxn
⟹(θTx)T=Y
⟹xθT=Y
⟹xTxθT=xTY
⟹θT=(xTx)−1xTY
Logistic Regression
In Logistic regression, 0≤h(θ)≤1
In Linear regression, h(θ)=θTx∈(R)
In Logistic regression, h(θ)=g(θTx)
where,
g(z)=1+e−z1=sigmoid/logisticfunction
⟹hθ(x)=1+e−θTx1
hθ(x) = estimated probability that y=1 on input x.
i.e., hθ(x)=P(y=1∣x;θ) = prob. that y=1, given x, parametrized by θ.
Now; hθ(x)=0.5
⟹1+e−θTx1=0.5
⟹θTx=0
so, hθ(x)≥0.5⟹θTx≥0
and, hθ(x)≤0.5⟹θTx≤0

Ex. Let hθ(x)=g(θ0+θ1x1+θ2x2)=g(θTx) (at θ=[−3,1,1])
⟹Predict yif −3+x1+x2≥0
⟹x1+x2≥3 (Linear decision boundary)
Cost function for logistic regression
J(θ)=−m1i=1∑m[yilog(h(xi,θ))+(1−yi)log(1−h(xi,θ))]
Following to to be completed . . .
Multi-class Classification
Neural Networks
Machine Learning Diagnostics