Introduction to Machine Learning Concepts
Introduction to Machine Learning Concepts
• It can enable top management of an organization to extract the knowledge from the data
stored in various archives of the business organizations to facilitate decision making.
Such decisions can be useful for organizations to
The hardware cost has dropped. Therefore, it is easier now to capture, process,
store, distribute, and transmit the digital information.
3. Availability of complex algorithms.
With the advent of deep learning, many algorithms are available for machine
learning.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Data can be numbers or text that can be processed by a computer.
Data sources such as flat files, databases, or data warehouses in different storage
formats.
Example: Sales data can be analyzed to extract information like which is the fast-
selling product.
The ultimate objective of knowledge pyramid is wisdom that represents the maturity of
mind that is, so far, exhibited only by humans.
In conventional programming
After understanding the problem, a detailed design of the program such as a flowchart
or an algorithm needs to be created and converted into programs using a suitable
programming language.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
This approach was impractical in many domains, as programs still depended on human
expertise and hence did not truly exhibit intelligence.
Machine learning is a form of data driven systems
The aim of machine learning is to learn a model or set of rules from the given dataset
automatically so that it can predict the unknown data correctly. Humans take decisions
based on an experience.
Computers make models based on extracted patterns in the input data and then use these
data-filled models for prediction and to take decisions.
Here,
f is the learning function that maps the input x to output y.
Learning of function f is the crucial aspect of forming a model in statistical learning.
A model is an explicit description of patterns within the data in the form of:
1. Mathematical equation
A model can be a formula, procedure or representation that can generate data decisions.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
The difference between pattern and model is that the former is local and applicable only
to certain attributes but the latter is global and fits the entire dataset.
Example
A model can be helpful to examine whether a given email is spam or not.
Another pioneer of AI, Tom Mitchell's definition of machine learning states that,
"A computer program is said to learn from experience E, with respect to task T
and some performance measure P, if its performance on T measured by P
improves with experience E."
The important components of this definition are experience E, task T, and performance
measure P.
Example: The task T could be detecting an object in an image. The machine can gain
the knowledge of object using training dataset of thousands of images. This is called
experience E. So, the focus is to use this experience E for this task of object detection
T. The ability of the system to detect the object is measured by performance measures
like precision and recall. Based on the performance measures, course correction can be
done to improve the performance of the system.
2. Once data is gathered, abstract concepts are formed out of that data.
Abstraction is used to generate concepts. This is equivalent to humans' idea of
objects, Example - we have some idea about how an elephant looks like.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Machine Learning in Relation to Other Fields
Machine learning uses the concepts of
1. Artificial Intelligence
2. Data Science
3. Statistics primarily
Deep learning is a subbranch of machine learning. In deep learning, the models are
constructed using neural network technology.
Neural networks are based on the human neuron models. Many neurons form a network
connected with the activation functions that trigger further neurons to perform tasks.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• It is a broad field that includes:
1. Big Data
2. Data Mining
3. Data Analytics
4. Pattern Recognition
1. Big Data
• Data science concerns about collection of data.
• Big data is a field of data science that deals with data's following characteristics:
3. Velocity: It refers to the speed at which the data is generated and processed.
• Big data is used by many machine learning algorithms for applications such as language
translation and image recognition and influences the growth of subjects like Deep
learning.
2. Data Mining
• Data mining's origin is in the business.
• It aims to extract the hidden patterns that are present in the data.
3. Data Analytics
• Branch of data science. It aims to extract useful knowledge from crude data.
• There are different types of analytics.
4. Pattern Recognition
• It uses machine learning algorithms to extract the features for pattern analysis and
pattern classification. One can view pattern recognition as a specific application of
machine learning.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
3. Machine Learning and Statistics
Statistics:
Focuses on hypotheses, experiments, and rigorous mathematical models to find
relationships in data.
Requires a strong theoretical background and often involves complex equations and
assumptions.
Machine Learning:
Less assumption-heavy compared to statistics and automates the learning process.
Often viewed as an evolved version of "old statistics."
Difference:
Labelled Data:
Data with target attributes (labels) is used for supervised learning.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Example 2: The Iris dataset includes features (e.g., sepal length, petal width) with a
target label (class of Iris flower).
Unlabelled Data:
• The types of learning are categorized based on the data used and the supervision
provided during the learning process.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
1. Supervised Learning
• Involves a teacher or supervisor providing labelled data for training and testing.
1. Classification
2. Regression
1. Classification
• The focus of classification is to predict the 'label' that is in a discrete form (a value from
the set of finite values).
• Example: A Classification algorithm takes a set of labelled data images such as dogs
and cats to construct a model that can later be used to classify an unknown test image
data.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• In classification, learning takes place in two stages.
1. First stage, called training stage, the learning algorithm takes a labelled dataset and
starts learning. After the training set, samples are processed and the model is
generated.
2. Second stage, the constructed model is tested with test or unknown sample and
assigned a label. This is the classification process.
a) Decision Trees
b) Random Forest
2. Regression
• Regression predicts continuous variables, such as prices or sales.
• Algorithm:
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Linear Regression: Fits a line (e.g., y=0.66x+0.54y = 0.66x + 0.54y=0.66x+0.54)
to predict outcomes based on independent variables.
2. Unsupervised Learning
• Self-instruction-based learning with no supervisor or labelled data.
• Example:
a) Cluster Analysis algorithm
Cluster Analysis:
• It aims to group objects into disjoint clusters or groups.
• Cluster analysis clusters objects based on its attributes.
All the data objects of the partitions are similar in some aspect and vary from the
data objects in the other partitions significantly.
Examples
a) Segmentation of a region of interest in an image
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• Algorithms:
1. k-means algorithm
2. Hierarchical algorithms
Dimensionality Reduction:
• The goal is to simplify the dataset by reducing the number of features without losing its
essential information.
3. Semi-Supervised Learning
• Semi-supervised learning operates in scenarios where a large portion of the dataset is
unlabeled, and only a small portion is labelled.
4. Reinforcement Learning
• Reinforcement learning is inspired by how humans learn through interaction and
feedback.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• An agent interacts with the environment, perceives its state, takes actions, and receives
rewards or penalties. The agent aims to maximize cumulative rewards by learning the
best actions to take over time.
• Key Concepts:
• The agent learns to navigate from the bottom-left grid to the goal by exploring various
paths and gaining rewards for successful actions or penalties for poor decisions.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
2. Huge data
• This is a primary requirement of machine learning.
• A quality data means it should be large and should not have data problems such as
missing data or incorrect data.
• Machine learning tasks have become complex and hence time complexity has
increased, and that can be solved only with high computing power.
5. Bias/Variance
• Variance is the error of the model. This leads to a problem called bias/ variance
tradeoff. Overfitting and underfitting are great challenges for machine learning
algorithms.
• A model that fits the training data correctly but fails for test data, in general lacks
generalization, is called overfitting.
• The reverse problem is called underfitting where the model fails for training data
but has good generalization.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
1. Understanding the business
• This step involves understanding the objectives and requirements of the business
organization.
• This step also involves the formulation of the problem statement for the data mining
process.
3. Preparation of data
• This step involves producing the final dataset by cleaning the raw data and
preparation of data for the data mining process.
• The missing values may cause problems during both training and testing phases.
4. Modelling
• This step plays a role in the application of data mining algorithm for the data to
obtain a model or pattern.
5. Evaluate
• This step involves the evaluation of the data mining results using statistical analysis
and visualization methods.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• The performance of the classifier is determined by evaluating the accuracy of the
classifier.
Example - Classification of emails requires extensive domain knowledge and
requires domain experts. Hence, performance of the classifier is very crucial.
6. Deployment
• This step involves the deployment of results of the data mining algorithm to
improve the existing process or for a new situation.
Example: For movie reviews or product reviews, five stars or one star are
automatically attached using sentiment analysis programs.
2. Recommendation systems
These are systems that make personalized purchases possible.
Example: Amazon recommends users to find related books or books bought by
people who have the same taste like you, and Netflix suggests shows or related
movies of your taste. The recommendation systems are based on machine learning.
3. Voice assistants
Products like Amazon Alexa, Microsoft Cortana, Apple Siri, and Google Assistant
are all examples of voice assistants.
They take speech commands and perform tasks. These chatbots are the result of
machine learning technologies.
4. Technologies like Google Maps and those used by Uber are all examples of machine
learning which offer to locate and navigate shortest paths to reduce time.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Understanding Data
Data
• Data is available in different data sources like flat files, databases, or data warehouses.
• Data can either be an operational data or a non-operational data.
Operational data is the one that is encountered in normal business procedures and
processes. Example - Daily sales data is operational data.
Non-operational data is the kind of data that is used for decision making.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Elements of Big Data or 6V’s of Big Data
• Big data is a larger data whose volume is much larger than 'small data' and is
characterized as follows:
1. Volume
Big Data is measured in terms of petabytes (PB) and exabytes (EB). One
exabyte is 1 million terabytes.
2. Velocity
The fast arrival speed of data and its increase in data volume is noted as
velocity.
Velocity helps to understand the relative growth of big data and its accessibility
by users, systems and applications.
3. Variety
The variety of Big Data includes:
a) Form
There are many forms of data. Data types range from text, graph, audio,
video, to maps.
There can be composite data too, where one media can have many other
sources of data. example, a video can have an audio song.
b) Function
These are data from various sources like human conversations, transaction
records, and old archive data.
c) Source of data
The data source can be classified as open/public data, social media data and
multimodal data.
4. Veracity of data
Veracity of data deals with aspects like conformity to the facts, truth- fulness,
believability, and confidence in data.
There may be many sources of error such as technical errors, typographical
errors, and human errors. So, veracity is one of the most important aspects of
data.
5. Validity
Validity is the accuracy of the data for taking decisions that are needed by the
given problem.
6. Value
Value indicates the value of the information that is extracted from the data and
its influence on the decisions that are taken based on it.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Types of Data
1. Structured Data
2. Unstructured Data
3. Semi-Structured Data
1. Structured Data
• In structured data, data is stored in an organized manner such as a database where it is
available in the form of a table.
• The data can also be retrieved in an organized manner using tools like SQL.
• The structured data in machine learning are listed below
Record Data
• A dataset is a collection of measurements taken from a process.
• We have a collection of objects in a dataset and each object has a set of measurements.
• The measurements can be arranged in the form of a matrix.
Rows in the matrix represent an object and can be called as entities, cases, or
records.
Data Matrix
• The data is thought of as points or vectors in the multidimensional space where every
attribute is a dimension describing the object.
Graph Data
• It involves the relationships among objects.
• Example - a web page can refer to another web page. The modes are web pages and the
hyperlink is an edge that connects the nodes.
Ordered Data
• It involves attributes that have an implicit order among them.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
The examples of ordered data are:
1. Temporal data - It is the data whose attributes are associated with time. For example,
the customer purchasing patterns during festival time is sequential data. Time series
data is a special type of sequence data where the data is a series of measurements over
time.
2. Sequence data - It is like sequential data but does not have time stamps. This data
involves the sequence of words or letters. For example, DNA data is a sequence of four
characters -ATGC.
3. Spatial data - It has attributes such as positions or areas. For example, maps are spatial
data where the points are related by location.
2 Unstructured Data
• Unstructured data includes video, image, and audio.
3 Semi-Structured Data
• Semi-structured data are partially structured and partially unstructured.
• These include data like XML/JSON data, RSS feeds, and hierarchical data.
1. Flat Files
• These are the simplest and most commonly available data source.
• These flat files are the files where data is stored in plain ASCII or EBCDIC format. Flat
file is suitable only for storing small dataset.
2. TSV files - TSV stands for Tab separated values files where values are separated
by Tab.
2. Database System
• Database files contain original data and metadata.
2
0
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• DBMS aims to manage data and improve operator performance by including various
tools like database administrator, query processing, and transaction manager.
• A user can access and manipulate the data in the database using SQL.
• Different types of databases are listed below:
1. A transactional database is a collection of transactional records. Each record is a
transaction. A transaction may have a time stamp, identifier and a set of items,
which may have links to other tables.
2. Time-series database stores time related information like log files where data is
associated with a time stamp.
• It is both human and machine interpretable data format that can be used to represent
data that needs to be shared across the platforms.
5. Data Stream
• It is dynamic data, which flows in and out of the observing environment. Typical
characteristics of data stream are huge volume of data, dynamic, fixed order movement,
and real-time constraints.
• It is another useful data interchange format that is often used for many machine learning
algorithms.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• Example, a business organization may want to know which is the fastest selling product,
in order for them to market activities.
• Data analysis is an activity that takes the data and generates useful information and
insights for assisting the organizations.
Data analytics refers to the process of data collection, preprocessing and analysis.
It deals with the complete cycle of data management.
Data analysis is just analysis and is a part of data analytics. It takes historical data
and does the analysis. Data analytics, instead, concentrates more on future and helps
in prediction.
1. Descriptive analytics
2. Diagnostic analytics
3. Predictive analytics
4. Prescriptive analytics
1. Descriptive Analytics
• Descriptive analytics deals with the collected data and quantifies it.
It is often stated that analytics is essentially statistics.
• Example, if a product is not selling diagnostic analytics aims to find out the reason.
3. Predictive Analytics
• This involves the application of algorithms to identify the patterns to predict the future.
• The entire course of machine learning is mostly about predictive analytics and forms
the core of this book.
4. Prescriptive Analytics
• It is about the finding the best course of action for the business organizations.
• Prescriptive analytics goes beyond prediction and helps in decision making by giving
a set of actions.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• It helps the organizations to plan better for the future and to mitigate the risks that are
involved.
4 Presentation Layer
• It has mechanisms such as dashboards, and applications that display the results of
analytical engines and machine learning algorithms.
• The Big Data processing cycle involves data management that consists of the following
steps.
1. Data collection
2. Data preprocessing
3. Applications of machine learning algorithm
4. Interpretation of results and visualization of machine learning algorithm
• This is an iterative process and is carried out on a permanent basis to ensure that data
is suitable for data mining.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Data Collection
• The first task of gathering datasets is the collection of data. Time is spent for collection
of good quality data. 'Good data' is one that has the following properties:
1. Timeliness -The data should be relevant and not stale or obsolete data.
2. Relevancy - The data should be relevant and ready for the machine learning or data
mining algorithms. All the necessary information should be available and there
should be no bias in the data.
3. Knowledge about the data - The data should be understandable and interpretable,
and should be self-sufficient for the required application as desired by the domain
knowledge engineer.
1. Open/public data
2. Social media data
3. Multimodal data.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
1. Open or public data source
• It is a data source that does not have any stringent copyright rules or restrictions.
• Its data can be primarily used for many purposes.
Digital libraries that have huge amount of text data as well as document images
Scientific domains with a huge collection of experimental data like genomic
data and biological data
Healthcare systems that use extensive databases like patient databases, health
insurance data, doctors' information, and bioinformatics information
2. Social media
• It is the data that is generated by various social media platforms like Twitter, Facebook,
YouTube, and Instagram.
3. Multimodal data
• It includes data that involves many modes such as text, video, audio and mixed types.
1. Image archives contain larger image databases along with numeric and text data
2. The World Wide Web (www) has huge amount of data that is distributed on the
Internet.
Data Preprocessing
• Data preprocessing improves the quality of the data mining techniques. The raw data
must be preprocessed to give accurate results.
• Data cleaning is the process of detection and removal of errors in data.
• Data wrangling is the process of making the data processable for machine learning
algorithms.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• Example: The 'bad' or 'dirty' data can be observed in below table.
The DoB of patients, John, Andre, and Raju, is the missing data.
The age of David is recorded as '5' but his DoB indicates it is 10/10/1980. This is
called inconsistent data.
Problems In Conversions
Inconsistent Formats
Difference In Units
Salary for John is -1500. It cannot be less than '0'. It is an instance of noisy data
• Outliers are data that exhibit the characteristics that are different from other data and
have very unusual values.
The age of Raju cannot be 136
• Outliers may be legitimate data and sometimes are of interest to the data mining
algorithms.
• These errors often come during data collection stage. These must be removed so that
machine learning algorithms yield better results as the quality of results is determined
by the quality of input data. This removal process is called data cleaning.
• Data cleaning routines attempt to fill up the missing values, smoothen the noise while
identifying the outliers and correct the inconsistencies of the data. This enables data
mining to avoid overfitting of the models.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• The procedures that are given below can solve the problem of missing data:
This method is not effective when the percentage of the missing values increases.
2. Fill in the values manually
The domain expert can analyze the data tables and carry out the analysis and fill
in the values manually.
• It can be removed by using binning, which is a method where the given data values are
sorted and distributed into equal frequency bins. The bins are also called as buckets.
• The binning method then uses the neighbor values to smooth the noisy data.
• Some of the techniques commonly used are
1. 'Smoothing by means' where the mean of the bin removes the values of the bins
2. 'Smoothing by bin medians' where the bin median replaces the bin values
3. 'Smoothing by bin boundaries' where the bin value is replaced by the closest bin
boundary. The maximum and minimum values are called bin boundaries.
• Binning methods can be used as a discretization technique.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Example: Consider the following set: S = [12, 14, 19, 22, 24, 26, 28, 31, 34). Apply various
binning techniques and show the result.
Solution:
• By equal-frequency bin method, the data should be distributed across bins.
• Let us assume the bins of size 3, then the above data is distributed across the bins
as shown below:
It can be observed in bin 1, the middle value 14 is compared with the boundary
values 12 and 19 and changed to the closest value, that is 12. This process is
repeated for all bins.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Some of the normalization procedures used are:
1. Min-Max
2. z-Score
Min-Max Procedure
• It is a normalization technique where each variable V is normalized by its difference
with the minimum value divided by the range to a new range, say 0-1.
• The formula to implement this normalization is given as:
Here,
max-min is the range. Min and max are the minimum and maximum of the given
data
New max and new min are the minimum and maximum of the target range, say 0
and 1
Example:
• Consider the set: V= (88, 90, 92, 94). Apply Min-Max procedure and map the marks to
a new range 0-1.
• Solution: The minimum of the list V is 88 and maximum is 94. The new min and new
max are 0 and 1, respectively. The mapping can be done using above equation as:
z- Score Normalization
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• This procedure works by taking the difference between the field value and mean value,
and by scaling this difference by standard deviation of the attribute.
V = V - μ/σ
• Here,
Data Reduction
• Data reduction reduces data size but produces the same results.
• There are different ways in which data reduction can be carried out such as
1. Data aggregation
2. Feature selection
3. Dimensionality reduction
Descriptive Statistics
• Descriptive statistics is a branch of statistics that does dataset summarization.
• It is used to summarize and describe data. Descriptive statistics are just descriptive and
does not bother about machine learning algorithms and its functioning.
• Data visualization is a branch of study that is useful for investigating the given data.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
The focus of EDA is to understand the given data and to prepare it for machine
learning algorithms. EDA includes descriptive statistics and data visualization.
• Every attribute should be associated with a value. The process is called measurement.
• The type of attribute determines the data types referred as measurement scale types.
1. Nominal Data
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• Nominal data type provides only information but has no ordering among data.
Example - The patient ID can be checked for equality and nothing else.
2. Ordinal Data
2. Ratio Data
For ratio data, both differences and ratio are meaningful.
The difference between the ratio and interval data is the position of zero in the scale.
Example - Take the Centigrade-Fahrenheit conversion. The zeroes of both scales
do not match. Hence, these are interval data.
Discrete Data
• This kind of data is recorded as integers.
• Example -
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Continuous Data
• It can be fitted into a range and includes decimal point.
• Example - Age is a continuous data. Though age appears to be discrete data, one may
be 12.5 years old and it makes sense. Patient height and weight are all continuous data.
• Third way of classifying the data is based on the number of variables used in the dataset.
• The data can be classified as
• It indicates, the dataset has only one variable. A variable can be called as a category.
Data Visualization
• Data visualization helps to understand data. It helps to present information and data to
customers.
• The graphs that are used in univariate data analysis are
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
1. Bar charts
2. Histograms
3. Frequency polygons
4. Pie charts
• The advantages of the graphs are
1. Presentation of data
2. Summarization of data
3. Description of data
4. Exploration of data
5. To make comparisons of data
1. Bar Chart:
• A Bar chart (or Bar graph) is used to display the frequency distribution for variables.
• Bar charts are used to illustrate discrete data. The charts can also help to explain the
counts of nominal data. It also helps in comparing the frequency of different groups.
• Example: The bar chart for students' marks (45, 60, 60, 80, 85) with Student ID = {1,
2, 3, 4, 5) is shown below.
2. Pie Chart
• These are helpful in illustrating the univariate data.
Example:
• The percentage frequency distribution of student’s mark {22, 22, 40, 40, 70, 70, 70, 85,
90, 90}
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• It could be observed that number of students with 22 marks is 2. Total number of
students are 10. so 2/20 * 100 = 20% is allocated for marks 22
3. Histogram
• Plays a role in Data mining showing frequency distributions.
• The histogram for student’s mark {45, 60, 60, 80, 85} in the group range of 0-25, 26-
50, 51-75, 76-100 is given below.
• Histogram conveys useful information like nature of data and its mode.
4. Dot Plots
• These are similar to bar charts. They illustrate bars only with single points.
• Example: The dot plot of English marks for five students with ID as {1, 2, 3, 4, 5} and
marks {45, 60, 60, 80, 85}
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Central Tendency
• Central tendency can explain the characteristics of data and that further helps in
comparison.
• Mass data have tendency to concentrate at certain values, normally in the central
location. It is called measure of central tendency (or averages). This represents the first
order of measures.
• Popular measures are
1. Mean
2. Median
3. Mode
1. Mean
• Arithmetic average (or mean) is a measure of central tendency that represents the
'center' of the dataset. This is used in our daily conversation such as average income or
average traffic.
• It can be found by adding all the data and dividing the sum by the number of
observations. Mathematically, the average of all the values in the sample (population)
is denoted as x.
• Let x1, x2, ….xN be a set of 'N' values or observations, then the arithmetic mean is given
as:
Weighted Mean
• Weighted mean gives different importance to all items as the item importance varies.
Hence, different weightage can be given to items.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• In case of frequency distribution, mid values of the range are taken for computation.
This is illustrated in the following computation.
• In weighted mean, the mean is computed by adding the product of proportion and group
mean.
Geometric mean
• Let x1, x2, ….xN be a set of 'N' values or observations.
2. Median
• The middle value in the distribution is called median.
If the total number of items in the distribution is odd, then the middle value is called
median.
If the numbers are even, then the average value of two items in the center is the
median.
• It can be observed that the median is the value where x, is divided into two equal halves,
with half of the values being lower than the median and half higher than the median.
• A median class is that class where (N/2)th item is present.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• Here, i is the class interval of the median class and L1, is the lower limit of median
class, f is the frequency of the median class, and cf is the cumulative frequency of all
classes preceding median.
3. Mode
• Mode is the value that occurs more frequently in the dataset.
• It is the value that has the highest frequency. It is only for discrete data and is not
applicable for continuous data as there are no repeated values in continuous data.
• The procedure for finding the mode is to calculate the frequencies for all the values in
the data, and mode is the value (or values) with the highest frequency.
• Normally, the dataset is classified as
Dispersion
• The spread out of a set of data around the central tendency (mean, median or mode) is
called dispersion. Dispersion is represented by various ways such as range, variance,
standard deviation, and standard error.
• These are second order measures. The most common measures of the dispersion data
are listed below:
1. Range: Range is the difference between the maximum and minimum of values of
the given list of data.
2. Standard Deviation: The mean does not convey much more than a middle point.
Example:
• The following datasets (10, 20, 30} and {10, 50, 0) both have a mean of 20.
• The difference between these two sets is the spread of data.
• Standard deviation is the average distance from the mean of the dataset to each
point.
• The formula for sample standard deviation is given by:
• Here,
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
xi is observation or value from the population and u is the population
mean.
Interquartile percentile = Q3 – Q1
Quartiles Range
• Quartile are values falling apart at least by the amount 1.5 * IQR above third
quartile or below the first quartile.
• Box plots can be used to illustrate data distributions and summary of data.
• The whiskers that project from the ends of the box indicate the spread of the tails and
the maximum and minimum of the data value.
Shape
• Skewness and Kurtosis (called moments) indicate the symmetry/asymmetry and peak
location of the dataset.
1. Skewness
• The measures of direction and degree of symmetry are called measures of third order.
• The dataset may either have very high values or extremely low values.
If the dataset has far higher values, then it is said to be skewed to the right.
If the dataset has far lower values, then it is said to be skewed towards left.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
If the tail is longer on the left-hand side and hump on the right-hand side, it is called
positive skew.
If the data is skewed, then there is a greater chance of outliers in the dataset.
This affects the mean and median. Hence, this may affect the performance of the
data mining algorithm.
A perfect symmetry means the skewness is zero.
• In the case of skew, the median is greater than the mean.
• The relationship between skew and the relative size of the mean and median can be
summarized by a convenient numerical skew index known as Pearson 2 skewness
coefficient.
Kurtosis
• Kurtosis also indicates the peaks of data.
• If the data is high peak, then it indicates higher kurtosis and vice versa.
• Kurtosis is the measure of whether the data is heavy tailed or light tailed relative to
normal distribution.
• Let x1, X2,….., XN be a set of 'N' values or observations. Then, kurtosis is measured
using the formula given below:
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
Mean Absolute Deviation (MAD)
• MAD is another dispersion measure and is robust to outliers.
• The outlier point is detected by computing the deviation from median and by dividing
it by MAD.
• Here, the absolute deviation between the data and mean is taken.
• Thus, the absolute deviation is given as:
• CV is the ratio of standard deviation and mean, and %CV is the percentage of
coefficient of variations.
• A stem and leaf plot are a display that help us to know the shape and distribution of the
data.
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri
• It can be seen from above diagram that the first column is stem and the second column
is leaf.
• For the given English marks, two students with 60 marks are shown in stem and leaf
plot as stem-6 with 2 leaves with 0.
• The Q-Q plot is a 2D scatter plot of an univariate data against theoretical normal
distribution data or of two datasets - the quartiles of the first and second datasets.
• The normal Q-Q plot for marks x= [1311234 89] is given below
Notes: Prepared by Akshatha Dange, Dept. of CSE (Iot, CS, BT), YIT, Moodabidri