Ai 1
Ai 1
HISTORY OF AI
Machine Learning
Example 1:
Find the missing number
2, 4, 8, 16, 32,?
Example 2:
Cricket match by looking at the baller’s body movement and action, we can predict and move either
left or right to hit the ball.
When a computer does this, it is called Machine Learning. You let the computer to learn from its
past experience / data.
Example 3:
The pricing of the house. The problem is that the construction dates are different, dozens of options
are available, locations are multiple, seasonal demands spike, and an array of many more hidden
factors.
Humans may not be able to keep all that data in mind, while calculating the price for prospective
houses. So we need robots to do the mathematics for us.
A machine copes with this task much better than a real person does when carefully analysing all the
dependencies in his/her mind. This heralds the birth of machine learning!
Examples of Machine Learning
1. Gmail automatically classifying emails as ‘Spam’ and ‘Not Spam’. Spam emails
being automatically sent to the Spam folder saving a lot of your time.
2. YouTube recommending you to watch videos of certain genre and the
recommended videos matching your choice of videos to a great extent.
4. When you upload photos to Facebook, the service automatically highlights faces
and suggests which friends to tag.
What is ML?
“Machine Learning is a discipline that deals with programming the
systems so as to make them automatically learn and improve with
experience”
A programmer accepts the input, gives the instruction (through Code / Computer
language) to the computer to produce an output/destination.
Python program to convert from Celcius to Fahrenheit
We are telling the computer what to do on the input data i.e. multiply Celcius with
1.8 and then add 32 to obtain the value in Fahrenheit.
2. Machine Learning (or AI) Approach
In Machine Learning (ML), the input data and the output data are fed to an
algorithm (Machine learning algorithm) to create a program. Unlike conventional
programming, Machine Learning is an automated process where a programmer
feeds the computer with ‘The Input + The Output’ and computer generates the
algorithm as to how the ‘The Output’ was achieved.
Python program to convert from Celcius to Fahrenheit
Using the Machine Learning approach, the code will be like
Step 1: Feed lot many values in Celcius (i.e. -40, -10, 0, 8, 15, 22, 38)
Step -2: Feed corresponding Fahrenheit values (i.e. -40, 14, 32, 46, 59, 72, 100)
Step -3: Pass these 2 sets of values to Machine Learning (ML) algorithm
Step- 4 : Now you ask the ML program to predict (convert) any other celcius value
to Fahrenheit , and program will tell you the answer.
In the ML approach, nowhere this conversion step (F = C*1.8 +32) has been
mentioned. Code was provided with the input date (Celcius) and corresponding
output data (Fahrenheit) and the model (ML code) automatically generates the
relationship between Celsius and Fahrenheit.
How is machine learning related to AI?
Machine Learning is a tool for achieving Artificial Intelligence
Machine learning provides machines the ability to learn, forecast and progress on
their own without specifically being programmed.
Eg) Imagine you have to make a robot that can see, talk, walk, sense and learn. In
order to achieve this task of making such a robot, one have to apply numerous
technologies but for the learning part, you will apply machine learning.
Data
Activity
https://data.gov.in/node/6721404
‘Structured data’ is most often categorized as quantitative data, and it's the type of
data most of us work with every day. Structured data has predefined data types
and format so that it fits well in the column/ fields of database or spreadsheet.
They are highly organised and easily analysed.
Eg) name, age, address etc. are examples of ‘Structured data’.
The data is structured in accurately defined fields. The data that can be stored in
relational databases or spread sheets (like Excel) is the best example of structured
data.
Unstructured data
Examples of unstructured data include text, video, audio, mobile activity, social
media activity, satellite imagery, surveillance imagery etc.
“Machine learning learning algorithms can figure out how to perform important
tasks by generalizing from examples”- – University of Washington
Of late, machine learning has achieved a great deal of popularity, but the first
attempt to develop a machine that imitated the behaviour of a living being was
made in the 1930s by Thomas Ross. Machine Learning (ML) is a term used today to
describe an application of AI which equips the system with the ability to learn and
improve from experience using the data that is accessible to it.
Supervised, Unsupervised and Reinforcement learning
Machine learning is often divided into three categories – Supervised, Unsupervised
and Reinforcement learning.
1. Supervised Learning
Supervised Learning occurs in the presence of a supervisor or a teacher. We train the machine with
labeled data (i.e. some data is already tagged with correct answer). It is then compared to the
learning which takes place in the presence of a supervisor or a teacher. A supervised learning
algorithm learns from labelled training data, and then becomes ready to predict the outcomes for
unforeseen data.
Example 1
Step 1: You provide the system with data that contains photos of apples and let it know that these
are apples. This is called labelled data.
Step 2: The model learns from the labelled data and the next time you ask it to identify an apple, it
can do it easily.
Activity
Suppose you have a data set entailing images of different bikes and
cars. Now you need to train the machine on how to classify all the
different images. How will you create your labelled data?
2. Unsupervised Machine Learning
Unsupervised learning is a ML technique where we don’t need to supply labelled
data, instead we allow the machine learning model (algorithm) to discover the
patterns on its own. The task of the machine is to assemble unsorted information
according to resemblances, patterns and variances without any former training of
data.
In this kind of learning, the machine is restricted to find a hidden structure in the
unlabelled data without guidance or supervision.
Example 1
If somebody gives you a basket full of different fruits and asks you to separate
them, you will probably do it based on their colour, shape and size, right?
Unsupervised learning works in the same way. As you can see in the image:
Step 1: You provide the system with a data that contains photos of different kinds
of fruits and ask it to segregate it. Remember, in case of unsupervised learning you
don’t need to provide labelled data.
Step 2: The system will look for patterns in the data. Patterns like shape, colour and
size and group the fruits based on those attributes.
Activity
Let's suppose you have never seen a Cricket match before and by chance watch a
video on the internet. Can you classify players on the basis of different criterion?
3. Reinforcement Machine Learning
In reinforcement learning, the machine is not given examples of correct input-
output pairs, but a method is provided to the machine to measure its performance
in the form of a reward. Reinforcement learning methods resemble how humans
and animals learn, the machine carries out numerous activities and gets rewarded
whenever it does something well.
Example
Imagine a small kid is given access to a laptop at home (environment). In simple
terms, the baby (agent) will first observe and try to understand the laptop
environment (state). Then the curious kid will take certain actions like hitting some
random buttons (action) and observe how the laptop would respond (next state).
As the non-responding laptop screen goes dull, the kid dislikes it (receiving a
negative reward) and probably won’t like to repeat the actions that led to such a
result (updating the policy) and vice versa. The kid will repeat the process until
he/she finds a button which turns the laptop screen bright (rewards) and will be
happy maximizing the total rewards.
Activity