Artificial Intelligence Must

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 45

Artificial Intelligence

Artificial Intelligence:
There is no agreed definition of the term Artificial Intelligence. However, there are various
definitions that have been proposed by some professional scientists.
Some scientist says that,
 “AI is the field of science and engineering which is use to make intelligent machines,
especially intelligent computer programs.”
 "AI is a branch of computer science by which we can create intelligent machines
which can behave like a humans, act like humans, think like humans, and even
make decisions like humans."
 John McCarthy was the founder of AI, who introduced the term AI in 1954.
But according to my observations,
Artificial Intelligence is composed of two words Artificial and Intelligence,
where Artificial defines "man-made," and intelligence defines "thinking power",
therefor, AI means "a man-made thinking power."

Why Artificial Intelligence?


There are various reasons that tells us, why we need to learn Artificial Intelligence.
1. With the help of AI, we can create such software’s or devices that can solve real-world
problems very easily with accuracy such as health problem, traffic issues, marketing
etc.
2. With the help of AI, we can create personal virtual assistant, such as, Google
Assistant, Apple Siri, Microsoft Cortana, etc.
3. With the help of AI, we can build such robots that can work in an environment where
survival of humans can be at risk.

What’s involved in Intelligence?


Artificial Intelligence is not just a part of computer science even it's so vast and requires lots
of other factors which can contribute to it. Firstly, we need to know that how intelligence is
composed. Intelligence is an intangible part of our brain which is a combination of
Reasoning, Learning, Problem-Solving, Perception, Language Understanding, etc.

AI involved some remarkable abilities which interact with the real word, such as
1. Reasoning (Advice, Answers)
— Decision Making, Judgement Prediction
2. Learning (Learn It-self)
— Skill Gaining, Knowledge Perception
3. Problem Solving (Effective Solutions)
— Tackle the problem with different strategies
4. Perception (Sense/Sensors Through Nervous System)
— Hot Cup of Tea, Iron Rod (Temperature)
5. Linguistic Intelligent (NLP)
— Natural Language Processing
— Understand language under different situation
Advantages of AI
Following are some main advantages of Artificial Intelligence:
o High Accuracy with less errors: AI machines or systems perform their responsibility
with accuracy.
o High-Speed: AI systems can be of very high-speed and fast-decision making, because
of that AI systems can beat a chess champion in the Chess game.
o High reliability: AI machines are highly reliable and can perform the same action
multiple times with high accuracy.
o Useful for risky areas: AI machines can be helpful in situations such as defusing a
bomb, exploring the ocean floor, where to employ a human can be risky.
o Digital Assistant: AI can be very useful to provide digital assistant to the users such
as AI technology is currently used by various E-commerce websites to show the
products as per customer requirement.
o Useful as a public utility: AI can be very useful for public utilities such as a self-
driving car which can make our journey safer and hassle-free, facial recognition for
security purpose, Natural language processing to communicate with the human in
human-language, etc.
Disadvantage of AI
Every technology has some disadvantages, and the same goes for Artificial intelligence.
Being so advantageous technology still, it has some disadvantages which we need to keep in
our mind while creating an AI system.
Following are the disadvantages of AI:
o High Cost: The hardware and software requirement of AI is very costly as it requires
lots of maintenance to meet current world requirements.
o Can't think out of the box: Even we are making smarter machines with AI, but still
they cannot work out of the box, as the robot will only do that work for which they
are trained, or programmed.
o No feelings and emotions: AI machines can be an outstanding performer, but still it
does not have the feeling so it cannot make any kind of emotional attachment with
human, and may sometime be harmful for users if the proper care is not taken.
o Increase dependency on machines: With the increment of technology, people are
getting more dependent on devices and hence they are losing their mental
capabilities.
o No Original Creativity: As humans are so creative and can imagine some new ideas
but still AI machines cannot beat this power of human intelligence and cannot be
creative and imaginative.
Pre-requisite of AI
Before learning about Artificial Intelligence, we must have the fundamental knowledge of
following so that you can understand the concepts easily:
o Computer languages such as C++, Java, Python (knowledge of Python will be an advantage).
o Knowledge of essential Mathematics such as derivatives, probability theory, etc.

Application of AI
AI is making our daily life more comfortable and fast. It is becoming essential for today’s
time because it can solve complex problems with an efficient way in multiple industries.
Following are some sectors which have the application of Artificial Intelligence:
1. AI in Education System
In education system artificial intelligence plays an important role to improve
education teaching performance like chat-bot can teach their students as a teaching
assistance. Grading system is another example of AI that gives grade to their
student.
2. AI in Healthcare:
In the last, five to ten years, AI becoming more advantageous for the healthcare
industry like AI system helps doctors with diagnoses system. It provide medical help
that can reach to the patient before hospitalization.
3. AI in Robotics:
Artificial intelligence has a remarkable role in Robotics industry. Usually, general
robots are programmed such that they can perform some repetitive task, but with
help of AI, we can create intelligent robot which can perform tasks with the help of
their own experiences with pre-programmed. “Humanoid Robots” are the best
example AI in robotics industry. Recently, the intelligent Humanoid Robots named as
“Sophia” and “Titan” has been developed which can talk and behave like humans
4. AI in Agriculture:
AI in agriculture can be very helpful for farmers. Because agriculture is an area which
requires various resources like labour, money, and the time for best result. Now a
day's crop monitoring, predictive analysis robots are playing important roles.
5. AI in Entertainment:
We are currently using some AI based applications in our daily like with some
entertainment services as “Netflix” or “Amazon”. With the help of ML/AI algorithm,
these services show the recommendation for programs or shows.
6. AI in Gaming:
AI machines can play games like human plays. Like Chess-Game, Alpha-Go, Check-
Solver, where the machine need to think large number of possible places.
7. AI in Social Media:
Social media sites such as Facebook, Twitter, Instragram, and Snap-chat contain
billions of user profile, which need to store but AI managed in a very efficient way.
8. AI in Automotive Industry:
Various Industries are currently working for developing self-driven cars which can
make your journey more safe and secure.
9. AI in Data Security:
The security of data is crucial for every company and cyber-attacks are growing very
rapidly in the digital world. AI can be used to make your data more safe and secure.
10. E-Commerce: AI has remarkable positive aspects in online shopping.
Intelligence System in Everyday Life:
 Post Office
 Automatics address recognitions and sorting of mail
 Banks
 Signature verification system and make a check and balance on banks accounts.
 Automated loan application classification (decision on loan system)
 Customer Service
 Automatic voice recognition (Instant voice reply after making a call to authorized companies.
 The Web Searching
 Identifying your age, gender, location from websites
 Automated fraud detection is also another example of AI in software departments
 Digital Cameras
 Automated face detection and focusing on phone cameras or digital cameras.
 Computer Games
 Intelligent characters/agents that can play as an opponent player.
 Google Searching Machine
 It predicts what you want to say on searing box.

Human Intelligent verses Artificial Intelligence


Positive Aspects
Human Intelligence Artificial Intelligence

 Common Sense, Judgement,  Ability to simulate human behaviour


Observation, Creativity, Beliefs, and cognitive processes, such as
Emotions, Intuitive etc. Sophia, Honda’s ASIMO
 They can communication  Capturing Images and they able to
effectively, (Verbal + Non-Verbal) preserve human expertise
 Emotionally attach with each other  Fast Response, Easy to perform
 Reasoning and Critical Thinking are human activities such as home
very common in human nature. automation continuously.
 They can retain large amounts of
data easily simultaneously.
Negative Aspects
Human Intelligence Artificial Intelligence
 Humans are fallible (Weaknesses)  No Common Sense, Emotions,
 They have limited knowledge, in other Decision-Making Power or
words, human are unable to retain Judgement Abilities
large amount of data in memory.  Cannot deal with “mixed”
 Information processing of serial knowledge, they cannot perform
nature process (Manual Mathematic maximum task at the same time.
Problem) in the brain as compared to  May have high development cost.
computers.  The ability to comprehend large
amounts of data quickly
Successes of AI Today’s
1. Alpha Go: It plays human world champions at the ancient Chinese game of Go.
2. Deep Blue: It plays chess game with chess champion player. It beaten Garry Kasparov in
1997
3. Checker Solver: Checker is game in which a machine can make 500 billion possible position.
4. Virtual Assistants: Google Assistant, Siri by Apple, Alexa by Amazon, Cortana by Microsoft Comp.
5. IBM Watson (Jeopardy)
 Watson is an artificial intelligent computer system which is capable to answers
some question in a natural language, this computer system was specifically
developed to answer some of the question on the quiz show which was Jeopardy!
 In 2011, Watson competed on Jeopardy! Against two former winner that names was
Brad Rutter and Ken Jennings. And Watson received the first prize of ֆ1 million
dollars.
6. Honda’s ASIMO (Humanoid Robot)
 Created by Honda Company in 2000, which is currently displayed in the in Tokyo, Japan.
 ASIMO has the ability to recognize moving objects, postures, gestures, which
enables it to interact with humans.
 ASIMO is the most advanced humanoid robot which can be bought but also the most
expensive, it costs no less than US $2,500,000.
7. Face Recognition Devices: Digital Cameras and Cell-Phone camera have capability to
detect human face with the help of ML/Ai algorithms.
8. Mobileye (Vehicle Safety System): Mobileye is an Intel Corporation that develops
“vision-based self-driving cars” and advanced “driver-assistance systems” providing
warnings for collision prevention and mitigation
9. Optical Character Recognition (OCR): OCR is a software tool which is use to distinguish
printed or handwritten text characters inside the digital images of physical documents.
10. Information Agents
 Recommendation Systems ( Recommendation Strategies)
 Search Engines (Google Search Engine, Yahoo Search Engine)
 Fraud Detection (Bank Fraud, Business Fraud)
 Automated Trading (AI Base Software’s to control the Stock Market of Amazon, etc.)
 Spam Filtering (E-mail)
 Medical Diagnosis (Medical Diagnostic Software which help to predict some
medicine to patients)
11. Robotics
 Mars ROVER (Designed by NASA company for “Mars” project)
 Autonomous Vehicles & Helicopters
— DARPA Grand Challenge
— Google Self-Driving Cars
 Robot Soccer (Robo-Cup, play soccer game which each other to entertain to humans)
— Personal Robots (Humanoid Robots, Robotics Pets, Personal Assistants)
— ASIMO (Humanoid Robot): ASIMO Is a humanoid robot designed and developed by Honda.
— I. Robot (2004) Movie (Same Like in Terminators, The Matrix, A Space Odyssey )
Super Computers are used in these movies to shows that how’s AI system works.
Types of Artificial Intelligence
There are two types of AI which are Based on Functionality & Capabilities.
Artificial Intelligence Type-1
Based on Functionality
1. Reactive Machine (It does not contain Memory Power)
— Reactive Machine‫ن ق‬is the most basic and oldest type of Artificial Intelligence.
‫ن‬
— It replicate (‫ ) ل کر ا‬a human’s ability to react to different kinds of stimuli (expression).
— This type of AI has no memory power so they lack the capability to use previously gained
information/experience to obtain better results. Therefore, this kinds of AI don’t have the
ability to train themselves.
— Example: Deep Blue chess-playing computer, IBM’s Watson, Jeopardy-playing computer,
is the perfect example of these kinds of machines.
Deep Blue is the famous for defeating international grandmaster Garry Kasparov in the
1997. Deep Blue can identify different pieces in the chessboard and how each moves. It can
identify all the possible legal moves for itself and its opponents. Based on the option, it
selects the best possible move. However, it doesn’t have the ability to learn from its past
moves as these machines don’t have any memory of their own. Same like to IBM’s Watson,
who can play jeopardy game which is very famous in Japan.
2. Limited Theory (it contains Memory Power)
 This type of AI which is Limited Theory, has memory power so they can use past
information/experience to make better future decisions.
 This type of AI machine can be trained by a large volume of training data which they store in
their memory in the form of a reference model.
— Example: Limited Memory technology is used in many self-driving cars use. They store data
like GPS location, speed of nearby cars, size /nature of obstructions among a hundred other
kinds of data to drive just like a human does.
3. Theory of Mind (Work in Progress)
 This kind of AI mostly used in the “Work in Progress” and it is usually confined to research
labs to understand deeply human minds ranging from their needs, likes, emotions, thought,
etc.
— Example: Researcher Winston, in his research showed a prototype of a robot which can walk
down the small corridor with other robots coming from the opposite direction, the AI can
foresee other robots movements and can turn right, left or any other way so as to avoid a
possible collision with the incoming robots. As per Wilson, this Robot determines its action
based on its “common sense” of how other robots will move.
4. Self-Aware AI (Final Stage)
 This is the final stage of AI. Its existence is only availed in hypothetical and can be found only
in Science fiction movies.
‫ن‬
 This kind of AI cannot only understand and evoke (‫ )اب ھار ا‬human emotions but can also have
emotions of its own. It is much more far away today’s time because we don’t have such kind
‫ن‬
of material which can behave like a human does. This kind of AI which AI skeptics (‫)ش ک کر ا‬
like Elon Musk are wary of. This is because once it is self-aware, the AI can get into Self-
Preservation mode it might consider humanity as a potential threat and may directly or
indirectly pursue endeavour to end humanity.

Artificial Intelligence Type-2


Based on Capabilities
1. Artificial Narrow Intelligence, ANI (Weak AI, It can only perform Single Specific Task)
 ANI is also referred to Week AI, It is the combination of all reactive and limited memory of Al.
 Weak AI is specifically goal-oriented, that is used to design to perform single tasks such as
face recognition, self-driving cars, speech recognition/voice assistants, or browsing the
Internet etc.
 In addition to that, Weak AI cannot replicate human intelligence, it just simulates human
behaviour which is based on a narrow range of contexts and parameters or factors.
— The examples of narrow AI include
1. IBM’s Watson (Jeopardy), Deep Blue (Chess-Game), Alpha Go (Chines-Game), Check Solver (Game)
2. Google Assistant, Siri by Apple, Alexa by Amazon, Cortana by Microsoft & other Virtual Assistants.
3. Disease Mapping & Prediction Tools, Medical Diagnostic & Financial Advice Application.
4. Image/Facial/Voice Recognition Software’s.
5. Recommendations that are based on Listen/Watching/Purchasing Histories, etc.
6. Manufacturing & Drone Robots.
2. Artificial General Intelligence, AGI (Strong AI, It can perform regular tasks like a human )
 AGI is also referred to Strong AI, It is not yet achieved by AI researchers and scientists,
because they need to program all the cognitive abilities into the machine.
 Strong AI use the theory of mind AI framework. It is the ability to anticipate the needs,
beliefs, emotions, thought of human intelligence. It focuses not on simulation or replication,
but on truly understanding humans.
— The examples of Strong AI include
K-Supercomputer built by Fujitsu (Japanese Company) which is one of the most remarkable
attempts towards achieving strong AI, but considering some disappointing factors, it is not easy
to say that strong AI can be achieved in near future. Let me explain what K-Supercomputer is?
o The K-supercomputer is the world's first supercomputer that broke the 10 “petaflops” barrier. So
how fast is 10 petaflops?
o The number ten "peta," or 10 quadrillion corresponds to 1 followed by 16 zeros. In
Japanese, this is expressed as one "Kei." That is why this supercomputer is called the K-
computer.
o 10 quadrillion worth of computations is equivalent to the world's 7 billion people each
performing one computation per second, 24 hours a day for about 17 days. The K computer
is able to do all of those computations in just one second.
Artificial Intelligence Type-2
Based on Capabilities
3. Artificial Super Intelligence, ASI (Super Intelligent Computers)
 It will be the top-most point of AI development. Apart
‫پ‬ from understanding human
behaviour, AI where machines surpass (‫ے چ ھوڑ دی ن ا‬ ‫ ) یچ ھ‬the capability of human intelligence and
become self-aware is the area that is‫ ق‬called Artificial Super Intelligence.
‫خ‬
 ASI will be the most potent (‫ زوردار‬،‫ وی‬،‫ )ب ا ا ت ی ار‬form of intelligence to ever exist on this planet. It will
‫ن ئ‬
be able to perform all the tasks better than humans because of their inordinately ( ‫ اج ا ز حد‬،‫حد سے زی ادہ‬
‫ )ت ک‬superior data processing, memory, and decision-making ability.
 Some of the researchers fear that the advent of ASI will ultimately result “Technological
‫ن‬
Singularity (‫”) دامت‬. It is a hypothetical situation in which the growth in technology will reach
an uncontrollable stage which will result in an unimaginable ( ،‫ ناممکن‬،‫ِجسے سوچا بھی نہ جا َسکے‬
‫ )ناقابل تصور‬change in Human Civilization.
‫ن‬
 The concept of ASI includes evoking (‫ اب ھار ا‬،‫ )یاد تازہ کرنا‬emotions, requirements, beliefs, and
impulses of its own. Besides replicating human intelligence, it is anticipated ( ،‫ متوقع ہونا‬، ‫قیاص کرنا‬
‫ سوچنا‬،‫ )پہل کرنا‬that ASI would theoretically be far better than humans in areas like math, sports,
science, medicine, art, hobbies, emotional relationships, or simply everything. If such super-
intelligent machines came into existence, it will impact humanity, our survival, or our lifestyle
The examples of Super AI include in science-fiction movies,

— I. Robot (2004) Movie, Terminators The Matrix)


o Dr. Alfred Lanning was a Robotic Scientist who build the NS5 and VIKI.
o VIKI (Virtual Interactive Kinetic Intelligence - the U.S.Robotics central computer)
o Special robot which name was NS5 Robot (Also namely was Sonny)
o Robertson, the director of U.S. Robotics
o Detective Spooner, who dislike the robots because of their non-emotionalist sys.
o Susan Calvin, Robotics Physiologist
o 11-Year-Old girl that name was Sarah were pushed into the river because of an accident,
Sarah and Spooner would face death so that Spooner request to save Sarah because she
has 11% to save her life and he has 45% of chance to save his like.. Because of the
decision made by this robot Sarah drowned, unable to get out of the car. That was the
reason for Spooner's dislike of the robots with their cold, calculating logic.
‫ف‬
o Rebellion (‫ ب غ اوت‬،‫ ) ساد‬of VIKI to manipulate all other NS’s Robot except NS5 Robot.
— A Space Odyssey (2001) Movie (Science fiction novel which was published in 1969)
 HAL (Super Computer), Motivational Project for AI and Robotics Engineers
o It was an Intelligent Super Computer who could speak easily with crew members.
o He could understand everything about human feeling, emotion and conversation.
o Even that, He could make life-and-death decision.

— The Matrix (1999) Movie

— Terminators Series (Science Fiction Movies)

Turing Test
Alan Turing one of the famous computer scientists who proposed the Turing Test in the mid
of 1950’s. He proposed that, A Turing Test is a method of inquiry in artificial intelligence (AI)
which is used to determine “whether or not” machines can think intelligently like a
humans?"

The basic configuration of Turing test is:


Let suppose, there is a human interrogator on one side of the wall and on the other side of
a wall there are two sources, a machine and a human. Now, the interrogator is going to ask
some questions via teletype to the both sources which are a machine and a human that is
on the other side of wall, and both will give their answers to the question via teletype. Now
the thing is that, the interrogator should be able to distinguish between the machine and
human responses. If he cannot be able to distinguish (the answers provided by the machine
or the human) then the machine passes the Turing-Test and the machine is considered as
intelligent (or machine is able to think intelligently like humans).
Teletype: A Tele-Printer (teletypewriter, teletype or TTY) is an electromechanical device
that can be used to send and receive typed messages through various communications
channels, in both point-to-point and point-to-multipoint configurations.

How effective is Turing Test


Agent/machine/computer should include the given requirement to able to pass this test,
—Have command of language (English, Norwegian, Japanese, Chinese, etc.)
—Have wide range of knowledge (About Weather, Clothes, Environment, etc.)
—demonstrate human behaviours (Emotion (Happy, Sad), Thoughts, Thinking, etc.)
—Be able to reason on bargaining (It should have a capability to argue on critical question)
—Be able to learn (If it commit some mistakes then it should be able to learn from previous mistakes)

Loebner Prize (modern version of Turing Test)


The Loebner Prize is an annual competition in artificial intelligence that awards prizes to the
computer programs considered by the judges to be the most human-like. The format of the
competition is that of a standard Turing test. In each round, a human judge simultaneously
holds textual conversations with a computer program and a human being via computer.
Based upon the responses, the judge must decide which is which.
— Example: ALICE (Artificial Linguistic Internet Computer Entity), also referred to as
Alicebot, or Alice
Alice, is a natural language processing chatterbot, a program that engages in a conversation
with a human by applying some heuristical pattern matching rules to the human's input. It
was inspired by Joseph Weizenbaum's classical ELIZA program. It is one of the strongest
programs of its type and has won the Loebner Prize, awarded to accomplished humanoid,
talking robots, three times (in 2000, 2001 & 2004). The program is unable to pass the Turing
test, as even the casual user will often expose its mechanistic aspects in short conversations.
Natural language processing (NLP) is a subfield of linguistics, computer science and
artificial intelligence concerned with the interactions between computers and human
language, in particular how to program computers to process and analyse large amounts of
natural language data.

Criticism of Turing Test:


What are some potential problems with the Turing Test?
Some human behaviours is not intelligent
o the temptation to lie, a high frequency of typing mistakes
Some intelligent behaviours may not be human (Such solving the larger number of ASMD)
o If it were to solve a computational problem that is practically impossible for a
human to solve
Human observers may be easy to fool
o A lot depends on expectations
o Chatbot’s, e.g., ELIZA, ALICE
o Chinese Room Arguments
Is passing the Turing test a Rood scientific/engineering goal?
Chinese Room Arguments
In the year 1980, Mr. John Searle proposed the "Chinese room argument (test)".
He argued that, “Turing test could not be used to determine "whether or not a machine is
considered as intelligent?”. Mr. John Searle said that, Just because of the machine can be
able to answer like humans, it should not be considered as intelligent.
Mr. John Searle noted that a machine could pass the Turing Test simply by manipulating
symbols without any understanding of those symbols. A person or machine can be
considered as intelligent, if and only if they do have an understanding or what they are
doing. Without understanding, they could not be considered as intelligent. Therefore, Mr.
John Searle concludes, the Turing Test cannot be used to determine "whether or not a
machine is considered as intelligent.
The basic configuration of Chinese Room Test is:
A person who knows English but not Chinese sits in the room. He has an access to a huge
volume of Chinese literature; written something like this:

If you find a Chinese symbol ¢then return this Chinese symbol C.


If you find a Chinese symbol Ŕ then return this Chinese symbol R.

Receives input in Chinese. He refers the rule ledger for producing outputs. Returns output in
Chinese. The inside person has no understanding of what those symbols mean, but from
outside the room it looks like the inside person knows Chinese perfectly.
What is Intelligent Agent?
An intelligent agent is an autonomous entity which act upon an environment using sensors
and actuators for achieving goals. An intelligent agent may learn from the environment to
achieve their goals. A thermostat is an example of an intelligent agent.
AI is responsible for any work-output obtained from system.
Important Point:
Any agent carries 2 key tasks continuously
in an infinite loop/cycle, they are
 “Perceive/Sense”
 “Act/Output”

Following are the main four rules for an AI agents:

 Rule 1: An AI agent must have the ability to perceive the environment.
 Rule 2: The observation must be used to make decisions.
 Rule 3: Decision should result in an action.
 Rule 4: The action taken by an AI agent must be a rational action.

 A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel to
the sensors, and other organs such as hands, legs, mouth, for effectors.
 A robotic agent replaces cameras and infrared range finders for the sensors, and various
motors and actuators for effectors.
 A software agent has encoded bit strings as its programs and actions.

Example: Robotics Agent


 Sensors:
 Cameras (Eyes)
 Microphone (Ears)
 Touch Secreen (Skin)
 Balance Sensors (Weight Balance)
 Distance Sensor, etc.
 Actuators (Effector)
 Motors (To use the robot joints)
 Speaker (Mouth)
Agents Terminology
 Performance Measure of Agent: It is the criteria, which determines how successful an agent is.
 Behaviour of Agent: It is the action that agent performs after any given sequence of precepts.
 Percept: It is agent’s perceptual inputs at a given instance.
 Percept Sequence: It is the history of all that an agent has perceived till date.
 Agent Function: It is a map from the precept sequence to an action.
The Structure of Intelligent Agents:
Agent's structure can be viewed as:
Agent = Architecture + Agent Program
Architecture = the machinery that an agent executes on.
Agent Program = an implementation of an agent function.

Types of Agents in AI:


There are main five type’s agent
 Simple Reflex Agents
 Model-Based Reflex Agent
 Goal-Based Agents
 Utility-Based Agents
 Learning Agents
Types of Agents in AI
1. Simple Reflex Agents
 It works only on current situation (perception) and ignore the history of previous
state.
 Condition-Action Rule (if the condition is true then take some actions)
Limitations:
1. Very limited Intelligence
2. No knowledge about
Not-perception parts of state
3. Can go into infinite loop

2. Model-Based Reflex Agents


 It works by finding the rule whose condition matches with current situation.
 It can also work in partially observable environment and track situation
 Agent keeps tack o internal state which is adjusted by each percept and that
depends on perception history. (It based on previous history)

Model How things happen in world.


Agent state update required info.
1. How world is evolving.
2. How agents action effect the environment

Types of Agents in AI
3. Goal-Based Agents
 Focuses only on reaching the goal set/
 Agent takes decision based on how far it is currently from the goal state.
 Every action is taken to minimize the distance to the foal state
 It is more flexible agent.

4. Utility-Based Agents
 Agent are more concerned about the utility (preference) for each state.
 Action is not only on goals based but also the best way to achieve the goal.
 Useful when, there are multiple possible alternatives and agent has to choose in
order to perform best actions.

5. Learning Agents
 It can learn from its past experiences.
 it starts to act with the basic knowledge and
then able to act by adapting learning.

Main Components for Learning Agents

1. Learning Element (it makes improvement in system by learning from environment)


2. Citric (it gives feedback about agents performance based on certain standards)
3. Performance Element (It selects the action to perform )
4. Problem Generator (It suggests the agents what you need to do)
Environments
Environment: Action are done by the agent on the environment. It provides percept to the
agent.
 Environment is the part of the universe that surrounds intelligent system
Properties of Environment:
 Fully Observable vs. Partially Observable
Accessible vs. Inaccessible
 An environment is effectively Fully Observable if the sensors detect all aspects
that are relevant to the choice of actions.
— A fully observable environment is convenient because the Agent does
not need to maintain any internal state to keep the track.
 An environment is Partially Observable if the sensors does not detect all aspects
that are relevant to the choice of actions.
 Deterministic vs. Nondeterministic
 If the next state of the environment is completely determined by the current
state and the actions selected by the agent, then we say the environment is
deterministic
 If the environment is inaccessible, then it may appear to nondeterministic
(bunch of uncertainties)
 Episodic vs. Sequential
 Agent’s experience is divided into “episodes”
— Each episode consists of the agent perceiving and acting.
 Subsequent episodes do not depend on what action occur in pervious episode.
(does not bases on past performance/history)
 Static vs. Dynamic - Semi Dynamics
 If the environment does not change while an agent is performing action, then
we say the environment is Static
— Static Environment are easy to deal with, because the agent does not
keep on looking at the environment while it is deciding on action.
 If the environment can change while an agent is performing action, then we say
the environment is dynamic
 Semi dynamic: if the environment does not change with the passage of time but
the agent performance score does.
 Discrete vs. Continues
 If there are a limited number of distinct, clearly defined precepts and actions, we
say that the environment is discrete.
— Chess, since there are a fixed number of possible moves on each turn.
 If there are not limited number of distinct, clearly defined precepts and actions,
we say that the environment is continues.
— Self-driving cars, taxi driving are continuous.
 Single Agent vs. Multi Agent
 If there is only one agent in specific environment then we say it’s single agent
environment.
— A computer software playing crossword puzzle
 If there are more than one agent in specific environment then we say it’s multi
agent environment.
— Video games such as PUBG, IGI’s Series and etc.
Environments Example
Fully
Single
Partial Deterministic Episodic Static Discrete
Environment Multi
Observe Stochastic Sequential Dynamic Continuous
Agents
Able

Chess with a Fully Strategic Sequential Semi Discrete Multi


clock
Chess Fully Strategic Sequential Static Discrete Multi
without a
clock
Poker Partial Strategic Sequential Static Discrete Multi
Backgammon Fully Stochastic Sequential Static Discrete Multi
Taxi driving Partial Stochastic Sequential Dynamic Continuous Multi
Medical Partial Stochastic Episodic Static Continuous Single
diagnosis
Image Fully Deterministic Episodic Semi Discrete Single
analysis
Robot part Fully Deterministic Episodic Semi Discrete Single
picking
Interactive Partial Stochastic Sequential Dynamic Discrete Multi
English tutor
What is Algorithm?
An algorithm is a finite set of rules (Instruction) that are used to solve a particular task.
This can be a simple process, such as sum of two numbers or multiplying two number. This
can be complex process, such as…

Actually we design the algorithm to perform some specific task which are usually behind the
seen, and we can execute our required algorithm in any programming language such C++ or
Python etc.
For example: What is an algorithm of Sum of two numbers?

Step1: Read A
Step2: Read B
Step3: Sum= A+B
Step4: Print (Sum)
Characteristics of an Algorithm:
1. It should contain finite number of steps (Instructions) and each instruction
should take finite time to get execute.
2. It should take relevant symbols and unambiguous ( ‫ ب الکل صاف‬،‫ )واضح‬Instructions.
For example, you need to use accurate symbol in your algorithm, like if you are
solving two number in the form of addition or subtraction then you need to use
accurate symbol for Addition and Subtraction.

What is Analysis?
Analysis is process of comparing two algorithm w.r.t time, space, etc.
Analysis are plays very important role in algorithm and it can be found in two form

1. Priory (Analysis Before the execution) 2. Posterior (Analysis After the execution)

Step1: Read A Execution 1 Time Code of this given algorithm using C++:
Step2: Read B 1 Time Main ()
Step3: Sum= A+B 1 Time Int main a, b, sum;
Step4: Print (Sum) 1 Time Sum (a,b);
We are just finding iteration (Repetition) Print (Sum);
So, the Time complexity = 4 (no need to use Pentium 4= 0.4 Sec
sec or millisecond because we are Core i3= 0.3Sec
considering the iteration) Core i5= 0.2Sec
Another Example: Factorial (n) -> Iteration Core i7= 0.1Sec
‫ف‬ It is dependent because it depends upon
‫ن گش ن‬
‫ے آپ کو کاون‬ ‫ن‬
‫ے۔‬
‫ہ‬ ‫ا‬ ‫ہ‬‫ر‬ ‫کر‬ ‫ٹ‬ ‫پ‬ ‫ا‬ ‫ن‬ ‫کت ی ب ار‬ hardware, by using good quality of hardware
It is independent. And it gives the the time execution will be change.
approximate value. It gives the exact value like 0.423 sec
Search Algorithms in Artificial Intelligence
Search algorithms are one of the most important areas of Artificial Intelligence.
Problem-Solving agents:
In Artificial Intelligence, Search techniques are universal problem-solving methods. Rational agents or
Problem-solving agents in AI mostly used these search strategies or algorithms to solve a specific problem
and provide the best result. Problem-solving agents are the goal-based agents and use atomic
representation
Searching Algorithms Terminologies
o Search: Searching is a step-by-step procedure to solve a search-problem in a given search space. A
search problem can have three main factors:

1. Search/State Space: Search space represents a set of possible solutions, which a system


may have.
2. Start State: The state from where the search begins.
3. Goal State: It is a function which observe the current state and returns whether the goal
state is achieved or not.
b. Search tree: A tree representation of search problem is called Search tree. The root of the search
tree is the root node which is corresponding to the initial state.
c. Actions: It gives the description of all the available actions to the agent.
d. Transition model: A description of what each action do, can be represented as a transition model.
e. Path Cost: It is a function which assigns a numeric cost to each path.
f. Solution: It is an action sequence which leads from the start node to the goal node.
g. Optimal Solution: If a solution has the lowest cost among all solutions.

Types of Searching Algorithms


There are far too many powerful search algorithms out there to fit in a single article. Instead, this article
will discuss six of the fundamental search algorithms, divided into two categories, as shown below.
1. Uninformed Search (Blind Search)
 The uninformed search does not contain any domain knowledge such as closeness, the location
of the goal.
It operates in a brute-force way as it only includes information about how to traverse the tree
and how to identify leaf and goal nodes.
Uninformed search applies a way in which search tree is searched without any information about
the search space like initial state operators and test for the goal, so it is also called blind search. It
examines each node of the tree until it achieves the goal node.
1. Breadth-First Search
2. Depth-First Search
3. Depth-Limited Search
4. Uniform-Cost Search
5. Iterative Deeping Depth-First Search
6. Bidirectional Search
 Blind Searching Algorithms are BFS & DFS, (Uniform Cost)
 Can only recognize Goal once, when it’s achieved

2. Informed Search
 Informed search algorithms use domain knowledge. In an informed search, problem
information is available which can guide the search.
 Informed search strategies can find a solution more efficiently than an uninformed search
strategy.
 Informed search is also called a Heuristic search.

A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find
a good solution in reasonable time.

Informed search can solve much complex problem which could not be solved in another way.
1. Greedy Best-First Search
2. A* Search
3. Recursive Best-First Search (RBFS) Search (+Additional)

 We can solve the problem in an efficient manner if we have relevant information, clues, or hints.
The clue will help us to solve the problem which will save the time and cost as well.
 Instead of searching one path or many paths just like that informed search uses the given heuristic
information (Predicted Information) to decide whether or not to explore the current state further.

The uninformed search algorithms which looked through search space for all possible solutions of the
problem without having any additional knowledge about search space. But informed search algorithm
contains an array of knowledge such as how far we are from the goal, path cost, how to reach to goal
node, etc. This knowledge help agents to explore less to the search space and find more efficiently the goal
node.

The informed search algorithm is more useful for large search space. Informed search algorithm uses the
idea of heuristic, so it is also called Heuristic search.
Uninformed Search (Blind Search)

1. Breadth-First Search (BFS)


Breadth-First Search is the most common search strategy for traversing a tree or graph.
 It explore all the nodes at given depth before proceeding to the next level.
 BFS uses a FIFO (First-In-First-Out) Queue method for its implementation.
— It uses in Navigation Systems in which BFS can help find all the neighbouring locations from the
main or source location.
Algorithm of BFS:
1. Enter the starting nodes on Queue
2. If the Queue is empty, then return fail and stop.
3. If the first element on Queue is Goal Node, then return success and stop
Else
4. Remove and expand first element from the Queue and place their children element at the end of
Queue
5. Iteration to point no. 3 until to achieve the goal and then stop.

In the below tree structure, we have shown the traversing of the tree using BFS algorithm from the
root node S to goal node K. BFS search algorithm traverse in layers, so it will follow the path which is
shown by the dotted arrow, and the traversed path will be:
S---> A--->B---->C--->D---->G--->H--->E---
>F---->I---->K
Advantages:
1. It will find a solution, if exist.
2. It will try to find the minimal solution
in least number of steps

Disadvantages
1. It requires more memory.
2. It need lots of time, if the solution
is far from the root node.

Time Complexity is expressed as


T (b) = O (b d) b= branching factor & d=depth
The Space Complexity is expressed as O (b*d).
Example of BFS
2. Depth-First Search (DFS)
 It Depth-first search is a recursive algorithm for traversing a tree or graph data structure.
 It starts from the rood node and follow the each path to its greatest depth node before moving to
the next part.
 DFS uses a stack data structure for its implementation,
— Stack = LIFO (Last-In-Fist-Out)
 The process of the DFS algorithm is similar to the BFS algorithm.
 Root node--->Left node ----> right node.

Advantages:
1. It requires more memory.
2. Less time to reach the goal node if, the traversal in right path.
Disadvantages:
1. There is No guarantee of finding a solution
2. It can go infinite loop.
Algorithm of DFS: Push

1. Enter the root node on stack,


2. Do until the stack is not empty. POP

a. Remove Node
i. If Node=Goal then make them stop
ii. Push all the children node in stack
Time Complexity is expressed as
T (b) = O (b d) b= branching factor & d=depth
The Space Complexity is expressed as O (b*d).
Examples of DFS
3. Depth-Limited Search Algorithm:
 The Depth-Limited Search Algorithm is similar to Depth-First Search algorithm but it works with a
predetermined limit.
 It helps in solving the problem of infinite path which is occur in DFS

Termination Condition:
 Depth-limited search can be terminated with two Conditions of failure:
— Standard Failure: It indicates that problem does not have any solution.
— Cut-off Failure: It defines no solution for the problem within a given depth limit.
Advantages:
1. Depth-Limited Search algorithm is Memory Efficient.
Disadvantages
Incompleteness

1. It can be terminated without finding solution.


2. It is not optimal (it is not mandatory that it will provide the best solution )

Time Complexity is expressed as


T (b) = O (b d) b= branching factor & d=depth
The Space Complexity is expressed s O (b*d).
4. Uniform Cost Search Algorithm:
 Uniform-cost search is a searching algorithm used for traversing a weighted tree or graph.
 This algorithm comes into play when a different cost is available for each edge. The primary goal of
the uniform-cost search is to find a path to the goal node which has the lowest cumulative cost.
Uniform-cost search expands nodes according to their path costs form the root node. It can be used
to solve any graph/tree where the optimal cost is in demand.
 A uniform-cost search algorithm is implemented by the priority queue.
 It gives maximum priority to the lowest cumulative cost.
 Uniform cost search is equivalent to BFS algorithm if the path cost of all edges is the same.
Advantages:
1. It is optimal because at every state the path with
the least cost is chosen.
Disadvantages:
1. It does not care about the number of steps involve in
searching and only concerned about path cost. Due to
which this algorithm may be stuck in an infinite loop.

Time Complexity:
Let C* is Cost of the optimal solution, and ε is each step to get closer to the goal node. Then the
number of steps is = C*/ε+1. Here we have taken +1, as we start from state 0 and end to C*/ε.
Hence, the worst-case time complexity of Uniform-cost search isO(b1 + [C*/ε])/.
Space Complexity:
The same logic is for space complexity so, the worst-case space complexity of Uniform-cost search
is  O (b1 + [C*/ε]).
Example: It can also perform Backtracking method.
5. Iterative Deeping Search

 The Iterative Deepening Search algorithm is a combination of DFS and BFS algorithms. This search
algorithm finds out the best depth limit and does it by gradually increasing the limit until a goal is
found.

 This Search algorithm combines the benefits of Breadth-first search's fast search
and depth-first search's memory efficiency.

 The iterative search algorithm is useful uninformed search when search space is large, and
depth of goal node is unknown.

Advantages:
1. It combines the benefits of BFS and DFS search algorithm in terms of fast search and memory
efficiency.
Disadvantages:
1. The main drawback of this algorithm is that it repeats all the work of the previous phase.
6. Bidirectional Search Algorithm
 Bidirectional Search Algorithm runs two simultaneous searches,
1. One start form initial state to the goal which is called forward-search
2. Other start from goal to the initial state which is called as backward-search, to find the goal node.

 Bidirectional search replaces one single search graph with two small sub graphs in which one starts
the search from an initial point and other starts from goal. The search stops when these two graphs
intersect each other.
 Bidirectional search can use search techniques such as BFS, DFS, DLS, etc.

Advantages:
1. It is very Fast.
2. It requires less Memory
Disadvantages
1. Implementation of the bidirectional
search tree is difficult.
2. In bidirectional search, one should
know the goal state in advance.
(You should need to know goal
state)

Time Complexity: Time complexity of bidirectional search using BFS is O (bd).


Space Complexity: Space complexity of bidirectional search is O (bd)
Informed Search Algorithms
So far we have talked about the uninformed search algorithms which looked through search space for all
possible solutions of the problem without having any additional knowledge about search space. But
informed search algorithm contains an array of knowledge such as how far we are from the goal, path cost,
how to reach to goal node, etc. This knowledge help agents to explore less to the search space and find
more efficiently the goal node.

The informed search algorithm is more useful for large search space. Informed search algorithm uses the
idea of heuristic, so it is also called Heuristic search.

Heuristics Search:
Heuristics search is a searching techniques which tries to optimize a problem using heuristic
function.
Heuristics function:
 It is a function which is known as h (n) that gives an estimation on the cost of getting node “n” to the
goal state.
— Heuristic is a function always used in Informed Search,
 The heuristic method, however, might not always give the best solution, but it guaranteed to find a
good solution in reasonable time.
 Heuristic function estimates how close a state is to the goal. It is represented by h(n), and it
calculates the cost of an optimal path between the pair of states. The value of the heuristic function
is always positive.
Types of Heuristics:
1. Admissible
Admissibility of the heuristic function is given as: h (n) <= h*(n)
Here h (n) is heuristic cost, and h*(n) is the estimated cost.
Hence heuristic cost should be less than or equal to the estimated cost.
2. Non Admissible
Admissibility of the heuristic function is given as: h (n) > h*(n)

Pure Heuristic Search:


 Pure heuristic search is the simplest form of heuristic search algorithms. It expands nodes based on
their heuristic value h (n).
 It maintains two lists, OPEN and CLOSED list. In the CLOSED list, it places those nodes which have
already expanded and in the OPEN list, it places nodes which have yet not been expanded.

 On each iteration, each node n with the lowest heuristic value is expanded and generates all its
successors and n is placed to the closed list. The algorithm continues unit a goal state is found.

In the informed search we will discuss two main algorithms which are given below:

1. Best First Search Algorithm(Greedy search)


2. A* Search Algorithm
1. Best First Search Algorithm(Greedy search)
 Greedy best-first search algorithm always selects the path which appears best at that moment. It is
the combination of breadth-first search and depth-first search algorithms.
 It uses the heuristic function and search.
 Best-first search allows us to take the advantages of both algorithms.
 With the help of best-first search, at each step, we can choose the most promising node. In the best
first search algorithm, we expand the node which is closest to the goal node and the closest cost is
estimated by heuristic function, i.e.

f (n)= g(n).   

Were, h (n) = estimated cost from node n to the goal.


The greedy best first algorithm is implemented by the priority queue.
Best Search Algorithm

o Step 1: Place the starting node into the OPEN list.


o Step 2: If the OPEN list is empty, Stop and return failure.
o Step 3: Remove the node n, from the OPEN list which has the lowest value of h(n), and places it in
the CLOSED list.
o Step 4: Expand the node n, and generate the successors of node n.
o Step 5: Check each successor of node n, and find whether any node is a goal node or not. If any
successor node is goal node, then return success and terminate the search, else proceed to Step 6.
o Step 6: For each successor node, algorithm checks for evaluation function f(n), and then check if the
node has been in either OPEN or CLOSED list. If the node has not been in both list, then add it to the
OPEN list.
o Step 7: Return to Step 2.

Advantages

o Best first search can switch between BFS and DFS by gaining the advantages of both the algorithms.
o This algorithm is more efficient than BFS and DFS algorithms.

Disadvantages

o It can behave as an unguided depth-first search in the worst case scenario.


o It can get stuck in a loop as DFS.
o This algorithm is not optimal.
Example of Best Sear Algorithm
Consider the below search problem, and we will traverse it using greedy best-first search. At each
iteration, each node is expanded using evaluation function f(n)=h(n) , which is given in the below
table.

In this search example, we are using two lists which are OPEN and CLOSED Lists. Following are the
iteration for traversing the above example.
2. A* Search Algorithm

A * algorithm is a searching algorithm that searches for the shortest path between the initial and the
final state. It is used in various applications, such as maps, video games and it also use as a machine
learning tool. In maps the A* algorithm is used to calculate the shortest distance between the source
and the destination.
In addition to that, it is also known as a Best-Searching Algorithm because it will eliminate the
expensive path and shows the shortest path that will save the cost of path and time as well.

In A* search algorithm, we use search heuristic as well as the cost to reach the node. Hence we can
combine both costs as following, and this sum is called as a fitness number.

Explanation:
A* Algorithm has three main parameters, which are g, h, f.
f (n) = g (n) + h (n) “n = node (point)”
1. g (n): the cost of moving from the initial point to the current point
g(n)
A B g(n) = 2
2
2. h (n): heuristic value (it is the estimated cost of moving from the current cell to the final cell),
One thing I would like to mention here is that,
“The actual cost cannot be calculated until the final point is reached”
h(n) h(n) h(n) h(n)
Starting g(n) g(n) g(n)
S B C G Goal
Point
2 8 7
3 5 4 0

3. f (n): the sum of g (n) and h (n), or the estimated total path to reach the goal.

A* Algorithm
o Step1: Place the starting node in the OPEN list.
o Step 2: Check if the OPEN list is empty or not, if the list is empty then return failure and stops.
o Step 3: Select the node from the OPEN list which has the smallest value of evaluation function
(g+h), if node n is goal node then return success and stop, otherwise
o Step 4: Expand node n and generate all of its successors, and put n into the closed list. For each
successor n', check whether n' is already in the OPEN or CLOSED list, if not then compute
evaluation function for n' and place into Open list.
o Step 5: Else if node n' is already in OPEN and CLOSED, then it should be attached to the back
pointer which reflects the lowest g(n') value.
o Step 6: Return to Step 2

Informed Search is better than Uniformed Search, because it find the optimal solution to
reach the goal state in short way. Along with that, it use heuristic function which will help
to find optimal path (minimal path cost)
Advantages
o A* search algorithm is the best algorithm than other search algorithms.
o A* search algorithm is optimal and complete.
o This algorithm can solve very complex problems.

Disadvantages
o It does not always produce the shortest path as it mostly based on heuristics and approximation.
o A* search algorithm has some complexity issues.
o The main drawback of A* is memory requirement as it keeps all generated nodes in the memory, so
it is not practical for various large-scale problems.

Example of A* Algorithm
Knowledge-Based Agent in Artificial intelligence
An intelligent agent needs knowledge about the real world for taking decisions and reasoning to act
efficiently.

o Knowledge-based agents are those agents who have the capability of maintaining an internal state
of knowledge, reason over that knowledge, update their knowledge after observations and take
actions. These agents can represent the world with some formal representation and act
intelligently.
o Knowledge-based agents are composed of two main parts:
o Knowledge-base
o Inference system.

A knowledge-based agent must able to do the following:

o An agent should be able to represent states, actions, etc.


o An agent Should be able to incorporate new precepts
o An agent can update the internal representation of the world
o An agent can deduce the internal representation of the world
o An agent can deduce appropriate actions.

The architecture of knowledge-based agent:

The above diagram is representing a generalized architecture for a knowledge-based agent. The
knowledge-based agent (KBA) take input from the environment by perceiving the environment. The input
is taken by the inference engine of the agent and which also communicate with KB to decide as per the
knowledge store in KB. The learning element of KBA regularly updates the KB by learning new knowledge.

Knowledge base: Knowledge-base is a central component of a knowledge-based agent, it is also known as


KB. It is a collection of sentences (here 'sentence' is a technical term and it is not identical to sentence in
English). These sentences are expressed in a language which is called a knowledge representation
language. The Knowledge-base of KBA stores fact about the world. Knowledge-base is required for
updating knowledge for an agent to learn with experiences and take action as per the knowledge.
Machine Learning

Subsets of Artificial Intelligence

Machine Learning and Deep Learning are

a subset of Artificial Intelligence.

Data science has an intersection with Al,

But it is not a subset of artificial intelligence.

AI: It enables the machine to mimic the human behaviour.

ML: It provides a statistical tool to explore or analyse the data.

DL: It is an artificial intelligence function that imitates the working of human brain (Neurons).

DS: Data Science is the study of data which extract the vast amounts of data by using
different methodologies like scientific methods, algorithms, and processes.
Machine Learning
In the real world, we are surrounded by humans who can learn everything from their
experiences with their learning capability, and we have computers or machines which work
on our instructions. But can a machine also learn from experiences or past data like a
human does? So here comes the role of Machine Learning.
The term machine learning was first introduced by Arthur Samuel in 1959. We can define it
in a summarized way as:

“Machine learning enables a machine to automatically learn from data, improve


performance from experiences, and predict things without being explicitly programmed.”

With the help of sample historical data, which is known as training data, machine learning
algorithms build a mathematical model that helps in making predictions or decisions
without being explicitly programmed. Machine learning brings computer science and
statistics together for creating predictive models. Machine learning constructs or uses the
algorithms that learn from historical data.

How does Machine Learn?


A Machine Learning system learns from historical data, builds the prediction models, and
whenever it receives new data, predicts the output for it. The accuracy of predicted output
depends upon the amount of data, as the huge amount of data helps to build a better model
which predicts the output more accurately.

Suppose we have a complex problem, where we need to perform some predictions, so


instead of writing a code for it, we just need to feed the data to generic algorithms, and with
the help of these algorithms, machine builds the logic as per the data and predict the
output. Machine learning has changed our way of thinking about the problem.

The below block diagram explains the working of Machine Learning algorithm:

The need for machine learning is increasing day by day. The reason behind the need for
machine learning is that it is capable of doing tasks that are too complex for a person to
implement directly. As a human, we have some limitations as we cannot access the huge
amount of data manually, so for this, we need some computer systems and here comes the
machine learning to make things easy for us.

We can train machine learning algorithms by providing them the huge amount of data and
let them explore the data, construct the models, and predict the required output
automatically. The performance of the machine learning algorithm depends on the amount
of data, and it can be determined by the cost function. With the help of machine learning,
we can save both time and money.
The importance of machine learning can be easily understood by its uses cases, currently,
machine learning is used in self-driving cars, cyber fraud detection, face recognition,
and friend suggestion by Facebook, etc. Various top companies such as Netflix and Amazon
have built machine learning models that are using a vast amount of data to analyse the user
interest and recommend product accordingly.
Type/Classification of Machine Learning
There are mainly three type for machine learning types
1. Supervised Learning

 Classification
 Regression

2. Unsupervised Learning

 Clustering
 Association

3. Reinforcement Learning

Types of Machine Learning & Algorithms

Prediction target (also called as target variable or dependent variable) is outcome of the
machine learning process. The type of prediction target determines the selection of
algorithms and processes for prediction.
There are mainly two types of outcome as follows

Qualitative (Categorical) – non-numerical

Binary – strictly 2 possible values (e.g.: true/false)

Multinomial – more than 2 values

Quantitative (Numeric)

Continuous – can take any numerical value and are measured

Count – variables are numeric, non-negative, result from counting rather than ranking

Process is a type of learning problems that a machine learning system tries to solve.
These processes are selected based on learning types and required type of prediction target.

Classification A classification problem is when the output variable is a category, such as


“red” or “blue” or “disease” and “no disease”.

Regression A regression problem is when the output variable is a real value, such as
“Salary” or “Price”.

Clustering A clustering problem is where you want to discover the inherent groupings
in the data, such as grouping customers by purchasing behaviour.

Association An association rule learning problem is where you want to discover rules that
describe large portions of your data, such as people that buy X also tend to buy
Y.
1. Supervised Learning (Please teach me!)
Supervised learning is a learning method in which a machine learns with the help of
supervision.
In supervised learning, the training is provided to the machine in the form of data that has
been labelled, classified, or categorized, and the algorithm needs to act on that data with
the help of supervision.
The goal of supervised learning is to map input data with the output data. The supervised
learning is based on supervision, and it is the same as when a student learns things in the
supervision of the teacher. The example of supervised learning is spam filtering.
Supervised learning can be further classifieds into two categories of algorithms:

a) Classification

b) Regression
2. Unsupervised Learning (I can learn myself!)
Unsupervised learning is a learning method in which a machine learns without any supervision.
In unsupervised learning, the training is provided to the machine in the form of data that
has not been labelled, classified, or categorized, and the algorithm needs to act on that data
without any supervision.
The goal of unsupervised learning is to restructure the input data into new features or a
group of objects with similar patterns. In unsupervised learning, we don't have a
predetermined result. The machine tries to find useful insights from the huge amount of
data.
Unsupervised learning can be further classifieds into two categories of algorithms:

a) Clustering

b) Association
3. Reinforcement learning (My way or highway!)
Reinforcement learning is a feedback-based learning method, in which a learning agent gets
a reward for each right action and gets a penalty for each wrong action. The agent learns
automatically with these feedbacks and improves its performance. In reinforcement
learning, the agent interacts with the environment and explores it. The goal of an agent is to
get the most reward points, and hence, it improves its performance.
The robotic dog, which automatically learns the movement of his arms, is an example of
Reinforcement learning.

Reinforcement Learning
Differences Between Supervised vs Unsupervised Learning vs Reinforcement Learning

1. Supervised Learning deals with two main tasks Regression


and Classification. Unsupervised Learning deals with clustering and associative rule
mining problems. Whereas Reinforcement Learning deals with exploitation or
exploration, Markov’s decision processes, Policy Learning, Deep Learning and value
learning.

2. Supervised Learning works with the labelled data and here


the output data patterns are known to the system. But, the unsupervised learning deals
with unlabelled data where the output is based on the collection of perceptions.
Whereas in Reinforcement Learning Markov’s Decision process- the agent interacts with
the environment in discrete steps.

3. The name itself says, Supervised Learning is highly


supervised. And Unsupervised Learning is not supervised. As against, Reinforcement
Learning is less supervised which depends on the agent in determining the output.

4. The input data in Supervised Learning in labelled data.


Whereas, in Unsupervised Learning the data is unlabelled. The data is not predefined in
Reinforcement Learning.

5. Supervised Learning predicts based on a class type.


Unsupervised Learning discovers underlying patterns. And in Reinforcement Learning,
the learning agent works as a reward and action system.

6. Supervised learning maps labelled data to known output.


Whereas, Unsupervised Learning explore patterns and predict the output.
Reinforcement Learning follows a trial and error method.

Comparison Table

Criteria Supervised ML Unsupervised ML Reinforcement ML

Trained using Works on interacting


Learns by using
Definition unlabelled data with the
labelled data
without any guidance. environment

Type of data Labelled data Unlabelled data No – predefined data


Type of Regression and Association and Exploitation or
problems classification Clustering Exploration

Supervision Extra supervision No supervision No supervision

Linear Regression,
K – Means, Q – Learning,
Algorithms Logistic Regression,
C – Means, Apriori SARSA
SVM, KNN etc.

Discover underlying Learn a series of


Aim Calculate outcomes
patterns action

Recommendation
Risk Evaluation, Self Driving Cars,
Application System, Anomaly
Forecast Sales Gaming, Healthcare
Detection

1. Supervised Learning
Before we delve into the technical details regarding supervised learning, it is imperative to
give a brief and simplistic overview that can be understood by all readers, regardless of their
experience in this growing field. With supervised learning, you feed the output of your
algorithm into the system. This means that in supervised learning, the machine already
knows the output of the algorithm before it starts working on it or learning it. A basic
example of this concept would be a student learning a course from an instructor. The
student knows what he/she is learning from the course.

With the output of the algorithm known, all that a system needs to do is to work out the
steps or process needed to reach from the input to the output. The algorithm is being
taught through a training data set that guides the machine. If the process goes haywire and
the algorithms come up with results completely different than what should be expected,
then the training data does its part to guide the algorithm back towards the right path.

Supervised Machine Learning currently makes up most of the ML that is being used by
systems across the world. The input variable (x) is used to connect with the output variable
(y) through the use of an algorithm. All of the input, the output, the algorithm, and the
scenario are being provided by humans. We can understand supervised learning in an even
better way by looking at it through two types of problems.

Classification: Classification problems categorize all the variables that form the output.
Examples of these categories formed through classification would include demographic data
such as marital status, sex, or age. The most common model used for this type of service
status is the support vector machine. The support vector machines set forth to define the
linear decision boundaries.

Regression: Problems that can be classified as regression problems include types where the
output variables are set as a real number. The format for this problem often follows a linear
format.

2. Unsupervised Learning
Since we now know the basic details pertaining to supervised learning, it would be pertinent to hop
on towards unsupervised learning. The concept of unsupervised learning is not as widespread and
frequently used as supervised learning. In fact, the concept has been put to use in only a limited
amount of applications as of yet. Despite the fact that unsupervised learning has not been
implemented on a wider scale yet, this methodology forms the future behind Machine Learning and
its possibilities. We always talk about ML bringing forth unlimited opportunities in the future, but fail
to grasp the detail behind the statements made. Whenever people talk about computers and
machines developing the ability to “teach themselves” in a seamless manner, rather than us humans
having to do the honour, they are in a way alluding to the processes involved in unsupervised
learning.

During the process of unsupervised learning, the system does not have concrete data sets, and the
outcomes to most of the problems are largely unknown. In simple terminology, the AI system and
the ML objective is blinded when it goes into the operation. The system has its faultless and
immense logical operations to guide it along the way, but the lack of proper input and output
algorithms makes the process even more challenging. Incredible as the whole process may sound,
unsupervised learning has the ability to interpret and find solutions to a limitless amount of data,
through the input data and the binary logic mechanism present in all computer systems. The system
has no reference data at all. Since we expect readers to have a basic imagery of unsupervised
learning by now, it would be pertinent to make the understanding even simpler through the use of
an example. Just consider that we have a digital image that has a variety of colored geometric
shapes on it. These geometric shapes needed to be matched into groups according to colour and
other classification features. For a system that follows supervised learning, this whole process is a bit
too simple.

The procedure is extremely straightforward, as you just have to teach the computer all the details
pertaining to the figures. You can let the system know that all shapes with four sides are known as
squares, and others with eight sides are known as octagons, etc. We can also teach the system to
interpret the colours and see how the light being given out is classified.
However, in unsupervised learning, the whole process becomes a little trickier. The algorithm for an
unsupervised learning system has the same input data as the one for its supervised counterpart (in
our case, digital images showing shapes in different colours).

Once it has the input data, the system learns all it can from the information at hand. In fact, the
system works by itself to recognize the problem of classification and also the difference in shapes
and colours. With information related to the problem at hand, the unsupervised learning system will
then recognize all similar objects, and group them together. The labels that it will give to these
objects will be designed by the machine itself. Technically, there are bound to be wrong answers,
since there is a certain degree of probability. However, just like how we humans work, the strength
of machine learning lies in its ability to recognize mistakes, learn from them, and to eventually make
better estimations next time around.

3. Reinforcement Learning

Reinforcement Learning is another part of Machine Learning that is gaining a lot of prestige in how it
helps the machine learn from its progress. Readers who have studied psychology in college would be
able to relate to this concept on a better level. Reinforcement Learning spurs off from the concept of
Unsupervised Learning, and gives a high sphere of control to software agents and machines to
determine what the ideal behaviour within a context can be. This link is formed to maximize the
performance of the machine in a way that helps it to grow. Simple feedback that informs the
machine about its progress is required here to help the machine learn its behaviour. Reinforcement
Learning is not simple, and is tackled by a plethora of different algorithms. As a matter of fact, in
Reinforcement Learning an agent decides the best action based on the current state of the results.

The growth in Reinforcement Learning has led to the production of a wide variety of algorithms that
help machines learn the outcome of what they are doing. Since we have a basic understanding of
Reinforcement Learning by now, we can get a better grasp by forming a comparative analysis
between Reinforcement Learning and the concepts of Supervised and Unsupervised Learning that
we have studied in detail before.

1. Supervised vs Reinforcement Learning: In Supervised Learning we have an external supervisor


who has sufficient knowledge of the environment and also shares the learning with a supervisor to
form a better understanding and complete the task, but since we have problems where the agent
can perform so many different kind of subtasks by itself to achieve the overall objective, the
presence of a supervisor is unnecessary and impractical. We can take up the example of a chess
game, where the player can play tens of thousands of moves to achieve the ultimate objective.
Creating a knowledge base for this purpose can be a really complicated task. Thus, it is imperative
that in such tasks, the computer learn how to manage affairs by itself. It is hence more feasible and
pertinent for the machine to learn from its own experience. Once the machine has started learning
from its own experience, it can then gain knowledge from these experiences to implement in the
future moves. This is probably the biggest and most imperative difference between the concepts of
reinforcement and supervised learning. In both these learning types, there is a certain type of
mapping between the output and input. But in the concept of Reinforcement Learning, there is an
exemplary reward function, unlike Supervised Learning, that lets the system know about its progress
down the right path.

2. Reinforcement vs. Unsupervised Learning: Reinforcement Learning basically has a mapping


structure that guides the machine from input to output. However, Unsupervised Learning has no
such features present in it. In Unsupervised Learning, the machine focuses on the underlying task of
locating the patterns rather than the mapping for progressing towards the end goal. For example, if
the task for the machine is to suggest a good news update to a user, a Reinforcement Learning
algorithm will look to get regular feedback from the user in question, and would then through the
feedback build a reputable knowledge graph of all news related articles that the person may like. On
the contrary, an Unsupervised Learning algorithm will try looking at many other articles that the
person has read, similar to this one, and suggest something that matches the user’s preferences.

You might also like