0% found this document useful (0 votes)
109 views78 pages

Ai Class 10

Uploaded by

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

Ai Class 10

Uploaded by

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

UNIT 2:

AI PROJECT CYCLE
PART-2
DATA EXPLORATION
DATA EXPLORATION THROUGH
VISUALIZATION
Objective - Know various data exploration techniques and its importance
Title: Data Exploration Approach: Activity
Summary: Students will explore different types of graphs used in
data visualization and will be able to find trends and patterns out of
it.
Learning Objectives:
1. Students will explore various types of graphical representations.
2. Students will learn how to visualize the data they have.
Learning Outcomes:
1. Recognize different types of graphs used in data visualization.
2. Exploring various patterns and trends out of the data explored.
Pre-requisites: Basic computer literacy
Key-concepts: Data Visualization
Data Exploration

At this stage, you try to interpret some useful information


out of the data you have acquired. For this, you explore
the data and try to put it uniformly for a better
understanding. This is known as Data Exploration.
In order to better understand the nature of the data, data
analysts utilize data visualization and statistical tools to
convey dataset characterizations, such as size, amount,
and accuracy.
Data exploration is a technique used to visualize data
in the form of statistical methods or using graphs.

you will visualise your collected data in a graphical format


for better understanding
Why Data Exploration?
a. Reduces complexity of data
b. A better understanding and provides insights
into data - Exploration helps you gain a better
understanding of a dataset, making it easier to
explore and use it later. It also helps to quickly
understand the data’s trends, relationships and
patterns.
c. Provide real time analysis
d. Define strategy for which model to use at a later
stage.
e. Help to make decisions
f. Communicate the same to others effectively. To
visualise data, we can use various types of visual
representations.
About Data Visualization Chart
• Data visualization charts are graphical
representations of data that use symbols to
convey a story and help people understand large
volumes of information.

• data visualisation techniques, visit this link:


https://datavizcatalogue.com/
Data Visualization
TYPES OF CHARTS
The following are some of the most frequent data
visualization chart and graph formats:
Data visualization
• Column Chart – A column chart is a basic
Visualization chart that uses vertical columns to
represent data series. Because column lengths are
easy to compare, column charts are an effective
approach to demonstrate the changes in the data.

• Bar Chart – A bar chart is a visual representation


of category data. The data is displayed in a bar chart
with multiple bars, each representing a different
category.
List down 5 new data visualisation techniques which
you learnt from https://datavizcatalogue.com

Use the right graph to display the data.


Select any two data features and plot their graphs. visualise your collected data in a
graphical format for better understanding. describe what trends or patterns have you
witnessed in it.
The type of graph you select should be the data feature which you want you to
visualise in that particular representation.
How to select a proper graph?
1.Comparison of Values -Show periodical changes. ie
Bar Chart
2. Comparison of Trends -Show changes over a period
of time ie Line Chart
3. Distribution of Data according to categories-Show
data according to category ie Histogram
4.Highlight a portion of a whole Highlight data
according to value ie Pie Chart
5.Show the relationship between data -Multiple charts
can be used
Modelling
Title: Modelling Approach: Session + Activity
Summary: Students will be introduced to rule based and AI models and undertake
activities to appreciate the distinction between each. They will receive an overview
ofthe various types of regression, classification and clustering models.
Learning Objectives:
1. Students are introduced to common regression, classification and clustering
models
2. Students are introduced to the decision tree algorithm as an example of rule-
based models
3. Students are introduced to image classification model.
Learning Outcomes:
1. List common regression, classification and clustering models
2. Explain how decision trees work
3. Describe the process involved in image classification
Pre-requisites: Nil
Key-concepts:
1. Learning AI process
2. Rule based vs AI model
3. Decision Trees
4. Image Classification
Artificial Intelligence
Artificial intelligence (AI) is the simulation of human intelligence in
robots that have been trained to think and act like humans. The
term can also refer to any machine that demonstrates, like humans,
the ability to learn and solve the problem is Artificial Intelligence.

Machine Learning, or ML, enables machines to improve at tasks


with experience. The machine learns from its mistakes and takes
them into consideration in the next execution. It improvises itself
using its own experiences. It’s essentially getting a machine to
accomplish something without being specifically programmed to do
so.
Deep Learning, or DL, enables software to train itself to perform tasks with
vast amounts of data. In deep learning, the machine is trained with huge
amounts of data which helps it into training itself around the data. Such
machines are intelligent enough to develop algorithms for themselves.
Machine Learning
• It is a subset of A.I and enables computers to
learn from experience without programming it
further.
• This technique is used to make computers
perform accurate predictions after analysing the
input given to it.
Modelling
The graphical representation during data
exploration is understandable to humans, but
computer understands binary language only for
analyzing trends and patterns and the machine
goes for mathematical representation of the
same. AI data needs to be modelled in one form
of mathematical form or the other.
So to develop any AI model, it is the mathematical
approach towards analyzing data
Modelling
• AI Modelling refers to developing algorithms, also
called models which can be trained to get intelligent
outputs.
Ie. writing codes to make a machine artificially
intelligent. This is the process of programming code
to create a machine artificially.
•An AI model is a program that has been trained to
recognize patterns using a set of data.
• You go through several models and select the ones
which match your requirements.
• After choosing the model, you implement it. This is
known as the Modelling stage.
A.I MODELS

There are broadly two types of AI modelling approaches.


Rule Based Approach
A decision rule is a simple IF-THEN statement consisting of a condition (also
called antecedent) and a prediction. Ie. Set of rules and decisions

Examples of Rule Based Approach


if you see a stop sign, you stop the car; if you see that your battery indicator is low, you
plug your device to charge or turn on the battery saver mode.

The developer feeds in data along with some ground rules to the model. The model
gets trained with these inputs and gives out answers in the form of predictions. So,
the machine follows the developer’s rules or instructions and completes its job
properly.

The machine does not gain any learning experience. Ie. Static, it is only limited as
defined by the developer.

This approach is commonly used when we have a known dataset or labelled


dataset.
Rule based Approach
• we have a dataset which tells us about the conditions on the basis of which we can
decide if child can go out to play golf or not. The parameters are: Outlook,
Temperature, Humidity and Wind.
All possibilities of these parameters are taken and see in which case the children may
play golf and in which case they cannot.

After looking through all the cases, we feed this data into the machine along with the
rules which tell the machine all the possibilities.
The machine trains on this data and now is ready to be tested. While testing the
machine, we tell the machine that Outlook Overcast; Temperature = Normal;
Humidity = Normal and Wind = Weak.

On the basis of this testing dataset, now the machine will be able to tell if the child can
go out to play golf or not and will display the prediction to us.
Rule based Approach
• suppose you have a dataset comprising of 100
images of apples and 100 images of bananas.
• To train your machine, you feed this data into the
machine and label each image as either apple or
banana.
• Now if you test the machine with the image of an
apple, it will compare the image with the trained data
and according to the labels of trained images, it will
identify the test image as an apple. This is known as
Rule based approach.
• The rules given to the machine in this example are
the labels given to the machine for each image in the
training dataset.
Rule Based A.I model
• Decision trees (most popular) follows a rule
based approach.
It is like an inverted tree with root on top and
leaves at the bottom, every component is known
as node
DECISION TREES
Following is a dataset comprising of 4 parameters (Outlook, Temperature,
Humidity and Wind ) which lead to the prediction of whether an Elephant
would be spotted or not.
Draw a Decision Tree for this dataset.
Learning Based Approach
Refers to the AI modelling where the model(program) can find
relationships/patterns and make decisions from a previously unseen
dataset (not defined by the developer). The machine learns by itself.
The A.l model gets trained to work on abstract, unstructured and
the random data fed to it and then is able to design a model which is
adaptive to the change in data and it figures out patterns and trends
out of it.
That is, if the model is trained with X type of data and the machine
designs the algorithm around it, the model would modify itself
according to the changes which occur in the data so that all the
exceptions are handled in this case.
Some definitions
• A machine learning Model - is a program that can
find patterns or make decisions from a previously
unsee
• A machine learning algorithm is a mathematical
method to find patterns in a set of data. Machine
Learning algorithms are often drawn from statistics,
calculus, and linear algebra. n dataset.
• The process of running a machine learning
algorithm on a dataset (called training data) and
optimizing the algorithm to find certain patterns or
outputs is called model training.
Learning Based Approach

• Generally this approach is followed when the data is


unlabelled and too random for a human to make sense
out of it. Under the Machine Learning approach the
developer feeds in data along with the answers. The
machine then designs its own algorithms and
methodologies to match the data with answers and
gives out the rules.
• Thus, the machine looks at the data, tries to extract
similar features out of it and clusters same datasets
together.
• In the end as output, the machine tells us about the
trends which it observed in the training data. This
approach is complex and needs high level of data
expertise.
Learning Based Approach
• For example, suppose you have a dataset of 1000
images of random stray dogs of your area.
• Now you do not have any clue as to what trend is being
followed in this dataset as you don’t know their breed, or
colour or any other feature.
• Thus, you would put this into a learning approach based
AI machine and the machine would come up with
various patterns it has observed in the features of these
1000 images.
• It might cluster the data on the basis of colour, size, fur
style, etc. It might also come up with some very unusual
clustering algorithm which you might not have even
thought of!
Activity : Teachable machine to demonstrate Supervised Learning
https://teachablemachine.withgoogl e.com/

Activity : Infinite Drum Machine to demonstrate Unsupervised learning


https://experiments.withgoogle.com/ai/drum-machine/view/
Types of machine learning-based models
Supervised learning
• In a supervised learning model, the dataset which is fed to the machine is
labelled. A supervised learning algorithm learns from labelled training data,
and then becomes ready to predict the outcomes for unforeseen data.

• In other words, we can say that the dataset is known to the person who is
training the machine only then he/she is able to label the data.
• A label is some information which can be used as a tag for data. For
example, students get grades according to the marks they secure in
examinations. These grades are labels which categorise the students
according to their marks.
• Eg. You are learning python using manuals and online tutorials by following
the code examples. Supervised learning is where you learn python by
understanding its features by practicing the examples that act as labeled
data and then using the knowledge acquired to write python programs for
unseen use cases.
Applications of Supervised Learning
• Image classification: Identify objects, faces, and other
features in images.
• Natural language processing: Extract information
from text, such as sentiment, entities, and relationships.
• Speech recognition: Convert spoken language into
text.
• Predictive analytics: Predict outcomes, such as sales,
customer churn, and stock prices.
• Medical diagnosis: Detect diseases and other medical
conditions.
• Fraud detection: Identify fraudulent transactions.
• Email spam detection: Classify emails as spam or not
spam.
Advantages of Supervised Machine Learning

• Supervised Learning models can have high


accuracy as they are trained on labelled data.
• The process of decision-making in supervised
learning models is often interpretable.
• It can often be used in pre-trained models which
saves time and resources when developing new
models from scratch.
Disadvantages of Supervised Machine Learning

• It has limitations in knowing patterns and may


struggle with unseen or unexpected patterns that
are not present in the training data.
• It can be time-consuming and costly as it relies
on labeled data only.
• It may lead to poor generalizations based on new
data.
There are two types of Supervised Learning

1. Classification
2. Regression
Classification: Where the data is classified according to the labelled
data. This model works on discrete dataset(represents a count
like total team members, population count, no. of moves in a
game etc. ) which means the data need not be continuous.
For example, in the grading system, students are classified on the
basis of the grades they obtain with respect to their marks in the
examination.
• Eating habits: Carnivorous, Herbivorous, Omni
• Seasons: summers, winters, spring, autumn
Regression:
• Regression: Such models work on continuous data. (are
measured like volume , weight, height, time, temp etc)
• For example, if you wish to predict your next salary, then
you would put in the data of your previous salary, any
increments, etc., and would train the model. Stock
exchange dataset, Real estate price prediction, Medical
insurance costs based on various factors etc. Here, the
data which has been fed to the machine is continuous.
Unsupervised Learning
An unsupervised learning model works on unlabelled
dataset. This means that the data which is fed to the
machine is random and there is a possibility that the
person who is training the model does not have any
information regarding it.
The unsupervised learning models are used to identify
relationships, patterns and trends out of the data
which is fed into it. It helps the user in understanding
what the data is about and what are the major features
identified by the machine in it.
It is of 2 types- Clustering and Dimensionality Reduction
Applications of Unsupervised Learning
• Clustering: Group similar data points into
clusters.
• Image segmentation: Segment images into
meaningful regions.
• customer segmentation, anomaly
detection, and data exploration.
Advantages of Unsupervised Machine Learning

• It helps to discover hidden patterns and various


relationships between the data.
• Used for tasks such as customer
segmentation, anomaly
detection, and data exploration.
• It does not require labeled data and reduces the
effort of data labeling.
Disadvantages of Unsupervised Machine Learning

• Without using labels, it may be difficult to


predict the quality of the model’s output.
• Cluster Interpretability may not be clear and
may not have meaningful interpretations.
• It has techniques such
as autoencoders and dimensionality
reduction that can be used to extract meaningful
features from raw data.
Types of Unsupervised Learning
• Clustering
• Dimensionality Reduction
CLUSTERING:

This is a Machine learning approach where the machine generates


its own rules or algorithms to differentiate amongst the given dataset
to achieve the pre-decided goal.
Clustering is the process of grouping data points into
clusters based on their similarity(common properties).
Eg. Think of sorting a huge stack of several pairs of socks on
the basis of size and colour.
Used in imaging, object identification, e-commerce data
The data fed to such a model is usually unlabelled or random and
thus the developer feeds in the data directly into the machine and
instructs it to build its own algorithm. Clustering works on discrete
dataset.
The machine then finds out patterns or trends out of the training
dataset and clusters the ones which follow the same pattern.
The output rules might be very different to what was expected as the
machine has its own way of recognising patterns.
CLUSTERING:
For example, if you have a random data of stray dogs which live in your
locality, since you are unable to find any meaningful pattern amongst them,
you would feed their data into the clustering algorithm. The algorithm would
then analyse the data and divide them into clusters according to their
similarities based on the trends noticed. The clusters are then given as the
output.
It is basically a collection of objects on the basis of similarity and
dissimilarity between them.
CLUSTERING:

• Example: Suppose the unsupervised learning algorithm is given an


input dataset containing images of different types of cats and dogs.
Suppose the machine has to classify an image into dog or cat
• The algorithm is never trained upon the given dataset, which means
it does not have any idea about the features of the dataset. The task
of the unsupervised learning algorithm is to identify the image
features on their own.

• Unsupervised learning algorithm will perform this task by clustering


the image dataset into the groups according to similarities between
images. We ,know both animals have 2 eyes, 2 ears and 4 legs.

• Now the machine has to learn on its own with new images of mixed
dogs and cats data set. It has to identify first which of the physical
characteristics of dogs are different from cat and group them based
on their attributes.
Supervised Learning Unsupervised Learning
Supervised learning algorithms are trained using labeled data. Unsupervised learning algorithms are trained using unlabeled
data.
Supervised learning model takes direct feedback to check if it is Unsupervised learning model does not take any feedback.
predicting correct output or not.
Supervised learning model predicts the output. Unsupervised learning model finds the hidden patterns in data.

In supervised learning, input data is provided to the model In unsupervised learning, only input data is provided to the
along with the output. model.
The goal of supervised learning is to train the model so that it The goal of unsupervised learning is to find the hidden patterns
can predict the output when it is given new data. and useful insights from the unknown dataset.
Supervised learning needs supervision to train the model. Unsupervised learning does not need any supervision to train
the model.
Supervised learning can be categorized Unsupervised Learning can be classified
in Classification and Regression problems. in Clustering and Associations problems.
Supervised learning can be used for those cases where we know Unsupervised learning can be used for those cases where we
the input as well as corresponding outputs. have only input data and no corresponding output data.
Supervised learning model produces an accurate result. Unsupervised learning model may give less accurate result as
compared to supervised learning.
Supervised learning is not close to true Artificial intelligence as Unsupervised learning is more close to the true Artificial
in this, we first train the model for each data, and then only it Intelligence as it learns similarly as a child learns daily routine
can predict the correct output. things by his experiences.
It includes various algorithms such as Linear Regression, It includes various algorithms such as Clustering, KNN, and
Logistic Regression, Support Vector Machine, Multi-class Apriori algorithm.
Classification, Decision tree, Bayesian Logic, etc.

In supervised learning training data is used to infer model In unsupervised learning training data is not used.
Optical Character Recognition Find a face in an image.
Less Computational Complexity More Computational Complex
Dimensionality Reduction
Dimensionality Reduction: We humans are able to visualise upto 3-Dimensions
only but according to a lot of theories and algorithms, there are various
entities which exist beyond 3-Dimensions. For example, in Natural language
Processing, the words are considered to be N-Dimensional entities. Which
means that we cannot visualise them as they exist beyond our visualisation
ability. Hence, to make sense out of it, we need to reduce their dimensions.
Here, dimensionality reduction algorithm is used.
As we reduce the dimension of an entity, the information which it contains starts getting
distorted. For example, if we have a ball in our hand, it is 3-Dimensions right now. But if
we click its picture, the data transforms to 2-D as an image is a 2-Dimensional entity. Now,
as soon as we reduce one dimension, at least 50% of the information is lost as now we will
not know about the back of the ball. Whether the ball was of same colour at the back or
not? Or was it just a hemisphere? If we reduce the dimensions further, more and more
information will get lost.
Hence, to reduce the dimensions and still be able to make sense out of the data, we use
Dimensionality Reduction.
Dimensionality Reduction
Reinforcement Learning (RL)
• Reinforcement learning is a machine learning training method based on
rewarding desired behaviors and/or punishing undesired ones.
• is a learning method that interacts with the environment by producing actions
and discovering errors Trial, error, and delay are the most relevant
characteristics of reinforcement learning. In this technique, the model keeps on
increasing its performance using Reward Feedback to learn the behavior or
pattern.
• It is about learning the optimal behavior in an environment to obtain maximum
reward. This optimal behavior is learned through interactions with the
environment and observations of how it responds, similar to children
exploring the world around them and learning the actions that help them
achieve a goal.
• In the absence of a supervisor, the learner must independently discover the
sequence of actions that maximize the reward. This discovery process is
akin to a trial-and-error search.
• The principle of reinforcement suggests that when we follow behavior
with pleasant consequences, that behavior is likely to be repeated.
Additionally, behavior followed by unpleasant consequences may be less
likely to be repeated.
• Activity : Teachable machine to demonstrate
Supervised Learning
https://teachablemachine.withgoogl e.com/
● Activity : Infinite Drum Machine to
demonstrate Unsupervised learning
https://experiments.withgoogle.com /ai/drum-
machine/view/
Evaluation

Objective - Know the importance of evaluation


and various metrics available for evaluation
Evaluation

After a model has been created and trained, it


must be thoroughly tested in order to determine its
efficiency and performance; this is known as
evaluation

Your surveillance system is now complete! You test


it by sending a mix of known and unknown faces to
the vault. You notice that the results were 70%
correct. After evaluating this model, you work on
other shortlisted AI algorithms and work on them.
• As you move towards deploying your model in
the real-world, you test it in as many ways as
possible. The stage of testing the models is
known as Evaluation.
• In this stage, we evaluate each and every model
tried and choose the model which gives the most
efficient and reliable results.
•You need to acquire data which will become the base of your project as it
will help you in understanding what the parameters that are related to the
problem are scoping.
•You go for data acquisition by collecting data from various reliable and
authentic sources. Since the data you collect would be in large quantities,
you can try to give it a visual image of different types of representations like
graphs, databases, flow charts, maps, etc. This makes it easier for you to
interpret the patterns in which your acquired data follows.
•After exploring the patterns, you can decide upon the type of model you
would build to achieve the goal. For this, you can research online and
select various models which give a suitable output.
•You can test the selected models and figure out which is the most efficient
one.
•The most efficient model is now the base of your AI project and you can
develop your algorithm around it.
•Once the modelling is complete, you now need to test your model on
some newly fetched data. The results will help you in evaluating your model
and hence improving it.
•Finally, after evaluation, the project cycle is now complete and what you
get is your AI project.
ARTIFICIAL NEURAL NETWORKS

The term "Artificial neural network" refers to a


biologically inspired sub-field of artificial
intelligence modeled after the brain. It is a
subset of machine learning and are at the heart
of deep learning algorithms.
Neural networks
• https://www.youtube.com/watch?v=VB1ZLvgHlYs
• https://www.youtube.com/watch?v=bfmFfD2RIcg
• https://www.youtube.com/watch?v=vpOLiDyhNUA
Advantages of Neural networks
The key advantage of neural networks are that
they are able to extract data features
automatically without needing the input of the
programmer.
A neural network is essentially a system of
organizing machine learning algorithms to
perform certain tasks. It is a fast and efficient
way to solve problems for which the dataset is
very large, such as in images.
• The neural network has layers of software units
called neurons (also called node), connected with
different neurons in a layered manner. The neurons that
are linked to each other in various layers of the
networks. These neurons are known as nodes.
This is a representation neural networks
Neural Networks
• A Neural Network is divided into multiple layers and each layer is further divided
into several blocks called nodes. Each node has its own task to accomplish which is
then passed to the next layer.
• The first layer of a Neural Network is known as the input layer. The job of an input
layer is to acquire data and feed it to the Neural Network. No processing occurs at the
input layer.
• Next to it, are the hidden layers. Hidden layers are the layers in which the whole
processing occurs. Their name essentially means that these layers are hidden and are
not visible to the user. Each node of these hidden layers has its own machine learning
algorithm which it executes on the data received from the input layer. The processed
output is then fed to the subsequent hidden layer of the network. There can be
multiple hidden layers in a neural network system and their number depends upon
the complexity of the function for which the network has been configured. Also, the
number of nodes in each layer can vary accordingly.
• The last hidden layer passes the final processed data to the output layer which then
gives it to the user as the final output. Similar to the input layer, output layer too does
not process the data which it acquires. It is meant for user-interface. .
Neural Networks

You might also like