0% found this document useful (0 votes)
8 views11 pages

Essential Machine Learning Formulas

The document outlines key machine learning concepts, including probability formulas, Bayes' Theorem, and methods for data normalization. It also describes the steps involved in Principal Component Analysis (PCA), from data collection to deriving a new dataset. Additionally, it covers various distance measures and entropy-based methods for information gain.

Uploaded by

amareljohari
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views11 pages

Essential Machine Learning Formulas

The document outlines key machine learning concepts, including probability formulas, Bayes' Theorem, and methods for data normalization. It also describes the steps involved in Principal Component Analysis (PCA), from data collection to deriving a new dataset. Additionally, it covers various distance measures and entropy-based methods for information gain.

Uploaded by

amareljohari
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Machine Learning Formulas:

--------------------------------------
∑p(w) = 1

P(A|B) is the conditional probability of event A given event B.

P(A and B) is the probability of both events A and B occurring.

P(B) is the probability of event B occurring.

Independent events:

Conditional Expectation
Likelihood function L(0): 7 heads, 3 Tails

Bayes' Theorem:

Marginalization:

Bayesian Networks:
Inference by Enumeration:

P(Appoinment=miss|light,no)=P(app|light,no,train=ontime) +
P(app|light,no,train=delay)

P(app|light,no,train=ontime)=p(app,no,light,ontime)/p(light,no,train=o
ntime)

X[P(app,light,no,train=ontime)

+P(app,light,no,train=delayed)]
Mean:
Median: the middle value of the ordered list of numbers.
Mode: set of data is the value in the set that occurs most often.

Inter-Quartile Range (IQR): IQR=Q3−Q1

A data value is an outlier if:

its value is <= (Q1–1.5*IQR),or

its value is >= (Q3+ 1.5*IQR).

Min-Max Normalization:

Mean Normalization:

X = Original data Value


μ= Mean

Z-Score Normalization:
Change in X direction(Gx)

Change in Y direction(Gy)

Magnitude =√[(Gx)2+(Gy)2]
Φ=arctan(Gy/Gx)

To normalize the matrix: for a given vector V : V


=[a1,a2,a3,….a36]
k =√(a1)^2+ (a2)^2+ (a3)^2+…. (a36)^2
Bayes' Law (for Naïve Bayesian Classifier):

Entropy-based methods are one common way

Conditional Entropy

Information Gain
Euclidean distance measure

Manhattan Distance Measure

Cosine Distance Measure


Eigen Value and Eigen Vector

Cost function of PCA


PCA Algorithm
Step-01:Get data. (2,1),(3,5),(4,3),(5,6),(6,7),(7,8).

Step-02:Compute the mean vector (μ). = ((2+3+4+5+6+7)/ 6,(1+5+3+6+7+8)/6)


=(4.5,5)

Step-03:Subtract mean from the given data.

x1–μ=(2–4.5,1–5)=(-2.5,-4)

x2–μ=(3–4.5, 5–5)=(-1.5,0)

x3–μ=(4–4.5,3–5)=(-0.5,-2)

x4–μ=(5–4.5, 6–5)=(0.5, 1)

x5–μ=(6–4.5, 7–5)=(1.5, 2)

x6–μ=(7–4.5, 8–5)=(2.5, 3)

Step-04:Calculate the covariance matrix.


Covariance matrix

=(m1+m2+m3+ m4+ m5+ m6)/6

Step-05:Calculate the eigen vectors and eigen values of the covariance matrix.

characteristic equation|M–λI|=0.

MX=λX

Step-06:Choosing components and forming a feature vector.

Step-07:Deriving the new dataset.

You might also like