Unit 1aiml
Unit 1aiml
Unit 1aiml
intelligently, in similarity to the manner humans use natural intelligence. (Or ) A method for
educating a computer, a robot controlled by a computer, or software to think critically and creatively
like a human mind is known as Artificial Intelligence.
According to “John McCarthy”, known as the father of Artificial Intelligence: AI is “The science
and engineering of making intelligent machines, especially intelligent computer programs”.
Supervised Learning: The algorithm is trained on a labeled dataset, where the input-output
pairs are provided. The algorithm learns the relationship between input and output and applies
this knowledge to unseen data. Examples: Linear Regression, Support Vector Machines
(SVM), and Neural Networks.
Unsupervised Learning: The algorithm is provided with an unlabeled dataset, and it
identifies patterns or structures in the data without guidance. Examples: Clustering (e.g., K-
means), Dimensionality Reduction (e.g., Principal Component Analysis), and Association
Rule Learning.
Reinforcement Learning: The algorithm learns from its actions and interactions with an
environment to maximize a reward signal. It’s particularly useful in decision-making and
control tasks. Examples: Q-learning, Deep Q-Network (DQN), and Policy Gradient methods.
Automation aims to improve productivity and efficiency by having machines perform monotonous
and repetitive tasks, resulting in cost-effective outcomes
Many organizations use machine learning, neural networks, and graphs in automation.
Using CAPTCHA technology, such automation can prevent fraud issues during online financial
transactions. Programmers create robotic process automation to perform high-volume repetitive tasks
that can adapt to changes in different circumstances.
Machine Vision
Machines can capture visual information and then analyze it.
This process involves using cameras to capture visual information, converting the analog image to
digital data, and processing the data through digital signal processing. Then the resulting data is fed to
a computer.
In machine vision, two vital aspects are sensitivity, the ability to perceive weak impulses, and
resolution, the range to which the machine can distinguish objects.
The usage of machine vision can be found in signature identification, pattern recognition, medical
image analysis, etc.
Deep Learning
Deep Learning takes ML to a higher level by employing neural networks with multiple layers to
process complex data representations. It has propelled AI achievements, such as beating human
champions in games like chess and Go and enhancing image and speech recognition systems.
Artificial Intelligence can be divided in various types, there are mainly two types of main
categorization which are based on capabilities and based on functionally of AI. Following is flow
diagram which explain the types of AI.
1. Reactive Machines
Purely reactive machines are the most basic types of Artificial Intelligence.
Such AI systems do not store memories or past experiences for future actions.
These machines only focus on current scenarios and react on it as per possible best action.
IBM's Deep Blue system is an example of reactive machines.
Google's AlphaGo is also an example of reactive machines.
2. Limited Memory
Limited memory machines can store past experiences or some data for a short period of time.
These machines can use stored data for a limited time period only.
Self-driving cars are one of the best examples of Limited Memory systems. These cars can
store recent speed of nearby cars, the distance of other cars, speed limit, and other information
to navigate the road.
3. Theory of Mind
Theory of Mind AI should understand the human emotions, people, beliefs, and be able to
interact socially like humans.
This type of AI machines are still not developed, but researchers are making lots of efforts
and improvement for developing such AI machines.
4. Self-Awareness
It represents information from the real world for a computer to understand and then utilize this
knowledge to solve complex real-life problems like communicating with human beings in natural
language.
Knowledge representation in AI is not just about storing data in a database, it allows a machine to
learn from that knowledge and behave intelligently like a human being.
Types of knowledge
Declarative Knowledge:
Declarative knowledge is to know about something.
It includes concepts, facts, and objects.
It is also called descriptive knowledge and expressed in declarativesentences.
It is simpler than procedural language.
Procedural Knowledge
It is also known as imperative knowledge.
Procedural knowledge is a type of knowledge which is responsible for knowing how to do
something.
It can be directly applied to any task.
It includes rules, strategies, procedures, agendas, etc.
Procedural knowledge depends on the task on which it can be applied.
Meta-knowledge:
AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent behavior:
The above diagram is showing how an AI system can interact with the real world and what
components help it to show intelligence.
AI system has Perception component by which it retrieves information from its environment.
It can be visual, audio or another form of sensory input.
The learning component is responsible for learning from data captured by Perception
comportment.
In the complete cycle, the main components are knowledge representation and Reasoning.
These two components are involved in showing the intelligence in machine-like humans.
These two components are independent with each other but also coupled together.
The planning and execution depend on analysis of Knowledge representation and reasoning.
Logical Representation
Semantic Network Representation
Frame Representation
Production Rules
Logical representation Logical representation is a language with some concrete rules which deals
with propositions and has no ambiguity in representation. Logical representation means drawing a
conclusion based on various conditions.
The syntax of propositional logic defines the allowable sentences for the knowledge representation.
There are two types of Propositions:
Atomic Proposition: Atomic propositions are the simple propositions. It consists of a single
proposition symbol. These are the sentences which must be either true or false.
Example:
a) 2+2 is 4, it is an atomic proposition as it is a true fact.
b) "The Sun is cold" is also a proposition as it is a false fact.
Logical Connectives:
Logical connectives are used to connect two simpler propositions or representing a sentence logically.
We can create compound propositions with the help of logical connectives. There are mainly five
connectives, which are given as follows:
Properties of Operators:
Commutativity:
P∧ Q= Q ∧ P, or
P ∨ Q = Q ∨ P.
Associativity:
(P ∧ Q) ∧ R= P ∧ (Q ∧ R),
(P ∨ Q) ∨ R= P ∨ (Q ∨ R)
Identity element:
P ∧ True = P,
P ∨ True= True.
Distributive:
P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
DE Morgan's Law:
¬ (P ∧ Q) = (¬P) ∨ (¬Q)
¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
Double-negation elimination:
¬ (¬P) = P.
Limitations of Propositional logic:
We cannot represent relations like ALL, some, or none with propositional logic. Example:
All the girls are intelligent.
Some apples are sweet.
Propositional logic has limited expressive power.
In propositional logic, we cannot describe statements in terms of their properties or logical
relationships.
Predicate logic
First-order logic is also known as Predicate logic or First-order predicate logic. First-order logic is
a powerful language that develops information about the objects in a more easy way and can also
express the relationship between those objects.
First-order logic (like natural language) does not only assume that the world contains facts like
propositional logic but also assumes the following things in the world
:
Objects: A, B, people, numbers, colors, wars, theories, squares, pits, wumpus, ......
Relations: It can be unary relation such as: red, round, is adjacent, or n-any relation such as: the
sister of, brother of, has color, comes between
Function: Father of, best friend, third inning of, end of, ......
Syntax
Semantics
The syntax of FOL determines which collection of symbols is a logical expression in first-order logic.
The basic syntactic elements of first-order logic are symbols. We write statements in short-hand
notation in FOL.
Basic Elements of First-order logic:
Constant 1, 2, A, John, Mumbai, cat,....
Variables x, y, z, a, b,....
Predicates Brother, Father, >,....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
Atomic sentences:
Atomic sentences are the most basic sentences of first-order logic. These sentences are formed from a
predicate symbol followed by a parenthesis with a sequence of terms.
We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).
Chinky is a cat: => cat (Chinky).
Complex Sentences:
Complex sentences are made by combining atomic sentences using connectives.
First-order logic statements can be divided into two parts:
Subject: Subject is the main part of the statement.
Predicate: A predicate can be defined as a relation, which binds two atoms together in a statement.
Consider the statement: "x is an integer.", it consists of two parts, the first part x is the subject of
the statement and second part "is an integer," is known as a predicate.
Universal Quantifier:
Universal quantifier is a symbol of logical representation, which specifies that the statement within its
range is true for everything or every instance of a particular thing.
The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.
In universal quantifier we use implication "→".
Example:
All man drink coffee.
∀x man(x) → drink (x, coffee).
Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that the statement within its scope is
true for at least one instance of something.
It is denoted by the logical operator ∃, which resembles as inverted E. When it is used with a
predicate variable then it is called as an existential quantifier.
If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:
There exists a 'x.'
For some 'x.'
For at least one 'x.'
Example:
Some boys are intelligent.
∃x: boys(x) ∧ intelligent(x)
b. Jerry is a mammal
In the above diagram, we have represented the different type of knowledge in the form of nodes and
arcs. Each object is connected with another object by some relation.
Frame Representation
1. A frame is a record like structure which consists of a collection of attributes and its values to
describe an entity in the world.
2. Frames are the AI data structure which divides knowledge into substructures by representing
stereotypes situations.
3. It consists of a collection of slots and slot values. These slots may be of any type and sizes.
Slots have names and values which are called facets.
4. Facets: The various aspects of a slot is known as Facets. Facets are features of frames which
enable us to put constraints on the frames. Example: IF-NEEDED facts are called when data
of any particular slot is needed. A frame may consist of any number of slots, and a slot may
include any number of facets and facets may have any number of values. A frame is also
known as slot-filter knowledge representation in artificial intelligence.
Frames are derived from semantic networks and later evolved into our modern-day classes and
objects. A single frame is not much useful. Frames system consist of a collection of frames which are
connected. In the frame, knowledge about an object or event can be stored together in the knowledge
base. The frame is a type of technology which is widely used in various applications including Natural
language processing and machine visions.
Example
Let's suppose we are taking an entity, Peter. Peter is an engineer as a profession, and his age is 25, he
lives in city London, and the country is England. So following is the frame representation for this:
Slots Filter
Name Peter
Profession Doctor
Age 25
Weight 78
1. The frame knowledge representation makes the programming easier by grouping the
related data.
2. The frame representation is comparably flexible and used by many applications in AI.
3. It is very easy to add slots for new attribute and relations.
4. It is easy to include default data and to search for missing values.
5. Frame representation is easy to understand and visualize.
4. Production Rules
Production rules system consist of (condition, action) pairs which mean, "If condition then
action". It has mainly three parts:
Example:
o IF (at bus stop AND bus arrives) THEN action (get into the bus)
o IF (on the bus AND paid AND empty seat) THEN action (sit down).
o IF (on bus AND unpaid) THEN action (pay charges).
o IF (bus arrives at destination) THEN action (get down from the bus).
1. Production rule system does not exhibit any learning capabilities, as it does not store
the result of the problem for the future uses.
2. During the execution of the program, many rules may be active hence rule-based
production systems are inefficient.
Procedural Knowledge means how a particular While Declarative Knowledge means basic
2.
thing can be accomplished. knowledge about something.
1.AI in Astronomy
Artificial Intelligence can be very useful to solve complex universe problems. AI technology can be
helpful for understanding the universe such as how it works, origin, etc.
2. AI in Healthcare
o In the last, five to ten years, AI becoming more advantageous for the healthcare industry and
going to have a significant impact on this industry.
o Healthcare Industries are applying AI to make a better and faster diagnosis than humans. AI
can help doctors with diagnoses and can inform when patients are worsening so that medical
help can reach to the patient before hospitalization.
3. AI in Gaming
o AI can be used for gaming purpose. The AI machines can play strategic games like chess,
where the machine needs to think of a large number of possible places.
4. AI in Finance
o AI and finance industries are the best matches for each other. The finance industry is
implementing automation, chatbot, adaptive intelligence, algorithm trading, and machine
learning into financial processes.
5. AI in Data Security
o 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. Some examples
such as AEG bot, AI2 Platform,are used to determine software bug and cyber-attacks in a
better way.
6. AI in Social Media
o Social Media sites such as Facebook, Twitter, and Snapchat contain billions of user profiles,
which need to be stored and managed in a very efficient way. AI can organize and manage
massive amounts of data. AI can analyze lots of data to identify the latest trends, hashtag, and
requirement of different users.
o AI is becoming highly demanding for travel industries. AI is capable of doing various travel
related works such as from making travel arrangement to suggesting the hotels, flights, and
best routes to the customers. Travel industries are using AI-powered chatbots which can make
human-like interaction with customers for better and fast response.
8. AI in Automotive Industry
o Some Automotive industries are using AI to provide virtual assistant to their user for better
performance. Such as Tesla has introduced TeslaBot, an intelligent virtual assistant.
o Various Industries are currently working for developing self-driven cars which can make your
journey more safe and secure.
9. AI in Robotics:
o Artificial Intelligence has a remarkable role in Robotics. Usually, general robots are
programmed such that they can perform some repetitive task, but with the help of AI, we can
create intelligent robots which can perform tasks with their own experiences without pre-
programmed.
o Humanoid Robots are best examples for AI in robotics, recently the intelligent Humanoid
robot named as Erica and Sophia has been developed which can talk and behave like humans.
10. AI in Entertainment
o We are currently using some AI based applications in our daily life with some entertainment
services such as Netflix or Amazon. With the help of ML/AI algorithms, these services show
the recommendations for programs or shows.
11. AI in Agriculture
o Agriculture is an area which requires various resources, labor, money, and time for best result.
Now a day's agriculture is becoming digital, and AI is emerging in this field. Agriculture is
applying AI as agriculture robotics, solid and crop monitoring, predictive analysis. AI in
agriculture can be very helpful for farmers.
12. AI in E-commerce
13. AI in education:
o AI can automate grading so that the tutor can have more time to teach. AI chatbot can
communicate with students as a teaching assistant.
o AI in the future can be work as a personal virtual tutor for students, which will be accessible
easily at any time and any place.
…………………………………………………………………………………………………
…………………………………………………
Statistics is a core component of data analytics and machine learning. It helps you analyze
and visualize data to find unseen patterns.
What Is Statistics?
Statistics is a branch of mathematics that deals with collecting, analyzing, interpreting, and visualizing
empirical data.
Descriptive statistics and inferential statistics are the two major areas of statistics.
Descriptive statistics are for describing the properties of sample and population data (what has
happened).
Inferential statistics use those properties to test hypotheses, reach conclusions, and make predictions
(what can you expect).
Use of Statistics in Machine Learning
Population: In statistics, the population comprises all observations (data points) about the subject
under study.
Sample: In statistics, a sample is a subset of the population. It is a small portion of the total observed
population.
Measures of central tendency are the measures that are used to describe the distribution of
data using a single value. Mean, Median and Mode are the three measures of central
tendency.
MEAN :The arithmetic mean is the average of all the data points.If there are n number of
observations and xi is the ith observation, then mean is:
Consider the data frame below that has the names of seven employees and their salaries.
To find the mean or the average salary of the employees, you can use the mean() functions in
Python.
Median: Median is the middle value that divides the data into two equal parts once it sorts the data
in ascending order.
If the total number of data points (n) is odd, the median is the value at position (n+1)/2.
When the total number of observations (n) is even, the median is the average value of
observations at n/2 and (n+2)/2 positions.
The median() function in Python can help you find the median value of a column. From the
above data frame, you can find the median salary as:
Mode : The mode is the observation (value) that occurs most frequently in the data set. There can
be over one mode in a dataset.
Given below are the heights of students (in cm) in a class: 155, 157, 160, 159, 162, 160, 161,
165, 160, 158 Mode = 160 cm.
The mode salary from the data frame can be calculated as:
Variance is used to measure the variability in the data from the mean.
Standard deviation in statistics is the square root of the variance. Variance and standard
deviation represent the measures of fit, meaning how well the mean represents the data.
You can find the standard deviation using the std() function in Python.
Range : The Range in statistics is the difference between the maximum and the minimum value of the
dataset.
Interquartile Range (IQR) : The IQR is a measure of the distance between the 1st quartile (Q1)
(25%) and 3rd quartile (Q3)(75%)
Skewness :
Skewness measures the shape of the distribution. A distribution is symmetrical when the proportion of
data at an equal distance from the mean (or median) is equal. If the values extend to the right, it is
right-skewed, and if the values extend left, it is left-skewed.