# 2.1 Machine learning lecture 2 course notes

 Page 1 / 6

## Generative learning algorithms

So far, we've mainly been talking about learning algorithms that model $p\left(y|x;\theta \right)$ , the conditional distribution of $y$ given $x$ . For instance, logistic regression modeled $p\left(y|x;\theta \right)$ as ${h}_{\theta }\left(x\right)=g\left({\theta }^{T}x\right)$ where $g$ is the sigmoid function. In these notes, we'll talk about a different type of learning algorithm.

Consider a classification problem in which we want to learn to distinguish between elephants ( $y=1$ ) and dogs ( $y=0$ ), based on some features of an animal. Given a training set, an algorithm like logistic regression or the perceptron algorithm (basically) tries to find a straight line—that is, a decision boundary—that separates the elephants anddogs. Then, to classify a new animal as either an elephant or a dog, it checks on which side of the decision boundary it falls, and makes its prediction accordingly.

Here's a different approach. First, looking at elephants, we can build a model of what elephants look like. Then, looking at dogs, we can build a separate model of whatdogs look like. Finally, to classify a new animal, we can match the new animal against the elephant model, and match it against the dog model, to see whether the new animal looks morelike the elephants or more like the dogs we had seen in the training set.

Algorithms that try to learn $p\left(y|x\right)$ directly (such as logistic regression), or algorithms that try to learn mappings directly from the space of inputs $\mathcal{X}$ to the labels $\left\{0,1\right\}$ , (such as the perceptron algorithm) are called discriminative learning algorithms. Here, we'll talk about algorithms that instead try to model $p\left(x|y\right)$ (and $p\left(y\right)$ ). These algorithms are called generative learning algorithms. For instance, if $y$ indicates whether an example is a dog (0) or an elephant (1), then $p\left(x|y=0\right)$ models the distribution of dogs' features, and $p\left(x|y=1\right)$ models the distribution of elephants' features.

After modeling $p\left(y\right)$ (called the class priors ) and $p\left(x|y\right)$ , our algorithm can then use Bayes rule to derive the posterior distribution on $y$ given $x$ :

$p\left(y|x\right)=\frac{p\left(x|y\right)p\left(y\right)}{p\left(x\right)}.$

Here, the denominator is given by $p\left(x\right)=p\left(x|y=1\right)p\left(y=1\right)+p\left(x|y=0\right)p\left(y=0\right)$ (you should be able to verify that this is true from the standard properties of probabilities), and thus canalso be expressed in terms of the quantities $p\left(x|y\right)$ and $p\left(y\right)$ that we've learned. Actually, if were calculating $p\left(y|x\right)$ in order to make a prediction, then we don't actually need to calculate the denominator, since

$\begin{array}{ccc}\hfill arg\underset{y}{max}p\left(y|x\right)& =& arg\underset{y}{max}\frac{p\left(x|y\right)p\left(y\right)}{p\left(x\right)}\hfill \\ & =& arg\underset{y}{max}p\left(x|y\right)p\left(y\right).\hfill \end{array}$

## Gaussian discriminant analysis

The first generative learning algorithm that we'll look at is Gaussian discriminant analysis (GDA). In this model, we'll assume that $p\left(x|y\right)$ is distributed according to a multivariate normal distribution. Let's talk briefly about the properties ofmultivariate normal distributions before moving on to the GDA model itself.

## The multivariate normal distribution

The multivariate normal distribution in $n$ -dimensions, also called the multivariate Gaussian distribution, is parameterized by a mean vector $\mu \in {\mathbb{R}}^{n}$ and a covariance matrix $\Sigma \in {\mathbb{R}}^{n×n}$ , where $\Sigma \ge 0$ is symmetric and positive semi-definite. Also written “ $\mathcal{N}\left(\mu ,\Sigma \right)$ ”, its density is given by:

Introduction about quantum dots in nanotechnology
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
it is a goid question and i want to know the answer as well
Maciej
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
for screen printed electrodes ?
SUYASH
What is lattice structure?
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
what's the easiest and fastest way to the synthesize AgNP?
China
Cied
types of nano material
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
what is nano technology
what is system testing?
Got questions? Join the online conversation and get instant answers!