Unit II Data Analytics
Unit II Data Analytics
Classification of analytics
Descriptive analytics
Descriptive analytics is a statistical method that is used to search and summarize historical data
inorder to identify patterns or meaning.
Objective: Understand what has happened in the past.
Function: Summarizes historical data to identify patterns or trends.
Tools: Dashboards, reports, data visualization.
Techniques: Data aggregation, data mining, slicing and dicing.
Examples:
Data aggregation and data mining are two techniques used in descriptive analytics to
discover historical data. Data is first gathered and sorted by data aggregation in order to make
the datasets more manageable by analysts.
Data mining describes the next step of the analysis and involves a search of the data to identify
patterns and meaning. Identified patterns are analyzed to discover the specific ways that
learners interacted with the learning content and within the learning environment.
Advantages:
Quickly and easily report on the Return on Investment (ROI) by showing how
performance achieved business or target goals.
Identify gaps and performance issues early - before they become problems.
Identify specific learners who require additional support, regardless of how many
students or employees there are.
Identify successful learners in order to offer positive feedback or additional
resources.
Analyze the value and impact of course design and learning resources.
Diagnostic Analytics
Objective: Understand why something happened.
Function: Drills deeper into data to find root causes or relationships.
Tools: OLAP (Online Analytical Processing), SQL queries, statistical analysis.
Techniques: Data discovery, correlation analysis, root cause analysis.
Examples:
Identifying why product sales declined in a specific region.
Investigating causes of customer complaints.
Predictive analytics
Predictive Analytics is a statistical method that utilizes algorithms and machine learning to
identify trends in data and predict future behaviors
The software for predictive analytics has moved beyond the realm of statisticians and is
becoming more affordable and accessible for different markets and industries, including the
field of learning & development.
For online learning specifically, predictive analytics is often found incorporated in the
Learning Management System (LMS), but can also be purchased separately as specialized
software.
For the learner, predictive forecasting could be as simple as a dashboard located on the main
screen after logging in to access a course. Analyzing data from past and current progress,
visual indicators in the dashboard could be provided to signal whether the employee was on
track with training requirements.
Advantages:
Examples:
Predicting customer churn.
Forecasting demand for a product.
Credit risk assessment.
Prescriptive analytics
Prescriptive analytics is a statistical method used to generate recommendations and make
decisions based on the computational findings of algorithmic models.
Objective: Recommend actions to influence future outcomes.
Function: Suggests the best course of action using optimization and
simulation.
Tools: Optimization engines, simulation tools, AI-based decision systems.
Techniques: Linear programming, decision analysis, reinforcement learning.
Examples:
Route optimization for delivery.
Dynamic pricing models.
Example
A Training Manager uses predictive analysis to discover that most learners without a particular
skill will not complete the newly launched course. What could be done? Now prescriptive
analytics can be of assistance on the matter and help determine options for action. Perhaps an
algorithm can detect the learners who require that new course, but lack that particular skill, and
send an automated recommendation that they take an additional training resource to acquire
the missing skill.
Data science
Data science is the professional field that deals with turning data into value such as new
insights or predictive models. It brings together expertise from fields including statistics,
mathematics, computer science, communication as well as domain expertise such as business
knowledge. Data scientist has recently been voted the No 1 job in the U.S., based on current
demand and salary and career opportunities.
Data mining
Data mining is the process of discovering insights from data. In terms of Big Data, because it
is so large, this is generally done by computational methods in an automated way using
methods such as decision trees, clustering analysis and, most recently, machine learning. This
can be thought of as using the brute mathematical power of computers to spot patterns in data
which would not be visible to the human eye due to the complexity of the dataset.
Hadoop
Hadoop is a framework for Big Data computing which has been released into the public
domain as open source software, and so can freely be used by anyone. It consists of a number
of modules all tailored for a different vital step of the Big Data process – from file storage
(Hadoop File System – HDFS) to database (HBase) to carrying out data operations (Hadoop
MapReduce – see below). It has become so popular due to its power and flexibility that it has
developed its own industry of retailers (selling tailored versions), support service providers and
consultants.
Predictive modelling
At its simplest, this is predicting what will happen next based on data about what has happened
previously. In the Big Data age, because there is more data around than ever before,
predictions are becoming more and more accurate. Predictive modelling is a core component
of most Big Data initiatives, which are formulated to help us choose the course of action which
will lead to the most desirable outcome. The speed of modern computers and the volume of
data available means that predictions can be made based on a huge number of variables,
allowing an ever-increasing number of variables to be assessed for the probability that it will
lead to success.
MapReduce
MapReduce is a computing procedure for working with large datasets, which was devised due
to difficulty of reading and analysing really Big Data using conventional computing
methodologies. As its name suggest, it consists of two procedures – mapping (sorting
information into the format needed for analysis – i.e. sorting a list of people according to their
age) and reducing (performing an operation, such checking the age of everyone in the dataset
to see who is over 21).
NoSQL
NoSQL refers to a database format designed to hold more than data which is simply arranged
into tables, rows, and columns, as is the case in a conventional relational database. This
database format has proven very popular in Big Data applications because Big Data is often
messy, unstructured and does not easily fit into traditional database frameworks.
Python
Python is a programming language which has become very popular in the Big Data space due
to its ability to work very well with large, unstructured datasets
R Programming
R is another programming language commonly used in Big Data, and can be thought of as
more specialised than Python, being geared towards statistics. Its strength lies in its powerful
handling of structured data. Like Python, it has an active community of users who are
constantly expanding and adding to its capabilities by creating new libraries and extensions.
Recommendation engine
A recommendation engine is basically an algorithm, or collection of algorithms, designed to
match an entity (for example, a customer) with something they are looking for.
Recommendation engines used by the likes of Netflix or Amazon heavily rely on Big Data
technology to gain an overview of their customers and, using predictive modelling, match
them with products to buy or content to consume. The economic incentives offered by
recommendation engines has been a driving force behind a lot of commercial Big Data
initiatives and developments over the last decade.
Real-time
Real-time means “as it happens” and in Big Data refers to a system or process which is able to
give data-driven insights based on what is happening at the present moment. Recent years have
seen a large push for the development of systems capable of processing and offering insights in
real-time (or near-real-time), and advances in computing power as well as development of
techniques such as machine learning have made it a reality in many applications today.
Reporting
The crucial “last step” of many Big Data initiative involves getting the right information to the
people who need it to make decisions, at the right time. When this step is automated, analytics
is applied to the insights themselves to ensure that they are communicated in a way that they
will be understood and easy to act on. This will usually involve creating multiple reports based
on the same data or insights but each intended for a different audience (for example, in-depth
technical analysis for engineers, and an overview of the impact on the bottom line for c-level
executives).
Spark
Spark is another open source framework like Hadoop but more recently developed and more
suited to handling cutting-edge Big Data tasks involving real time analytics and machine
learning. Unlike Hadoop it does not include its own filesystem, though it is designed to work
with Hadoop’s HDFS or a number of other options. However, for certain data related processes
it is able to calculate at over 100 times the speed of Hadoop, thanks to its in-memory
processing capability. This means it is becoming an increasingly popular choice for projects
involving deep learning, neural networks and other compute-intensive tasks.
Structured Data
Structured data is simply data that can be arranged neatly into charts and tables consisting of
rows, columns or multi-dimensioned matrixes. This is traditionally the way that computers
have stored data, and information in this format can easily and simply be processed and mined
for insights. Data gathered from machines is often a good example of structured data, where
various data points – speed, temperature, rate of failure, RPM etc. – can be neatly recorded and
tabulated for analysis.
Unstructured Data
Unstructured data is any data which cannot easily be put into conventional charts and tables.
This can include video data, pictures, recorded sounds, text written in human languages and a
great deal more. This data has traditionally been far harder to draw insight from using
computers which were generally designed to read and analyze structured information.
However, since it has become apparent that a huge amount of value can be locked away in this
unstructured data, great efforts have been made to create applications which are capable of
understanding unstructured data – for example visual recognition and natural language
processing.
Visualization
Humans find it very hard to understand and draw insights from large amounts of text or
numerical data – we can do it, but it takes time, and our concentration and attention is limited.
For this reason effort has been made to develop computer applications capable of rendering
information in a visual form – charts and graphics which highlight the most important insights
which have resulted from our Big Data projects. A subfield of reporting (see above),
visualizing is now often an automated process, with visualizations customized by algorithm to
be understandable to the people who need to act or take decisions based on them.
* R is a language for statistical computing and graphics. It also used for big
data analysis. It provides a wide variety of statistical tests.
Features:
* Apache Spark is a powerful open source big data analytics tool. It offers
over 80 high-level operators that make it easy to build parallel apps. It is
used at a wide range of organizations to process large datasets.
Features:
* Plotly is an analytics tool that lets users create charts and dashboards to
share online.
Features:
Features:
Features:
Features:
Easy to learn.
Provides support for multiple technologies and platforms.
No hiccups in installation and maintenance.
Reliable and low cost.
CAP Theorem:
CAP Theorem in Big Data is a pivotal concept that underpins the architecture of
distributed systems in the age of massive data sets and real-time processing.
Conceived by Eric Brewer, the CAP Theorem presents a triad of critical
properties, namely Consistency, Availability, and Partition Tolerance.
One property often must be prioritised at the expense of the others. This
framework plays a significant role in guiding the design choices for systems
dealing with vast and complex data, ensuring they strike the right balance
between data accuracy, system responsiveness, and fault tolerance. In this blog,
you will learn about how the CAP Theorem in Big Data plays an important role
in distributed computing and database systems, significantly impacting the
design and operation of Big Data systems.
Understanding What is the CAP Theorem in Big Data
a) Consistency
b) Availability
c) Partition Tolerance
d) Big Data and CAP Theorem
Example of the CAP Theorem in Big Data
a) MongoDB
b) Cassandra
1) Consistency
Consistency, the first element of the CAP Theorem, signifies that every read
operation in a distributed system will return the most recent write or an error. In
other words, all nodes within the system exhibit the same data value at any
given time. Achieving strong consistency is crucial in applications where data
accuracy is paramount, such as financial transactions or healthcare records.
2) Availability
The second property, Availability, indicates that every request, whether it's a
read or write operation, receives a response, and that response is not an error. In
essence, the system is always operational and responsive to client requests.
High availability is essential for systems that cannot tolerate downtime, like e-
commerce platforms or real-time analytics.
3) Partition Tolerance
Partition tolerance relates to the system's ability to function reliably despite
network partitions or communication breakdowns. Network partitions can occur
due to factors like hardware failures, congestion, or geographical distribution,
leading to nodes being unable to communicate. A partition-tolerant system
will continue to operate, ensuring nodes can communicate even under
challenging network conditions.
The CAP theorem declares that, in a distributed system, you can't
simultaneously achieve all three properties. Instead, you must prioritise two out
of the three, and the choice of which two significantly impacts the system's
behaviour:
a) CA or Consistency and Availability: Prioritising both Consistency and
Availability means that the system maintains strong data consistency and high
responsiveness but sacrifices Partition Tolerance. It can work well in stable
network conditions, but it may become problematic during network partitions.
b) CP or Consistency and Partition Tolerance: Emphasising Consistency and
Partition Tolerance ensures strong data consistency and the ability to withstand
network partitions, but it might result in periods of unavailability during
partition events.
c) AP or Availability and Partition Tolerance: Focusing on Availability and
Partition Tolerance aims for high system availability and the ability to operate
under network partitions. However, this might come at the cost of relaxing
strong consistency, allowing for temporary data inconsistencies.
Predict market trends and demographics by signing up for our Big Data for
Data Engineering Training now!
Big Data and CAP Theorem
In Big Data, distributed systems are prevalent, given the vast amounts of data
that need to be processed, stored, and analysed. The CAP Theorem provides
valuable guidance in making architectural decisions for these systems:
a) Data Consistency in Big Data: Big Data applications often prioritise
eventual consistency over strong consistency. In scenarios like real-time
analytics or recommendation engines, it's acceptable for data to temporarily be
inconsistent across nodes as long as it converges to a consistent state over time.
This approach improves system availability.
b) High Availability in Big Data: High availability is a paramount requirement
for Big Data systems, as they often deal with massive workloads and must serve
data without interruptions. Technologies like Hadoop and Spark typically adopt
the AP model, focusing on availability and partition tolerance.
c) Partition Tolerance in Big Data: Big Data systems inherently require
partition tolerance due to the large-scale distribution of data. Technologies like
Apache Kafka, used for streaming data, focus on partition tolerance and fault
tolerance.
Looking at an Example of the CAP Theorem in Big Data
Consider the example of an e-commerce application that combines real-time
product availability with uninterrupted customer access, handling network
disruptions seamlessly. It prioritises high availability and partition tolerance to
ensure 24/7 shopping while sacrificing strict consistency for occasional, minor
delays in updating product quantities during peak traffic, striking an effective
balance.
Here are the various ways the e-commerce application demonstrates the CAP
Theorem in Big Data:
With the advent of Big Data, the structured approach fails miserably to cater to
the needs of the humongous information processing that tends to be
unstructured. Over time, SQL has undergone many iterations to support the vast
data processing and pipelines. However, answering big data systems that expect
a quick response and supreme scalability is still inefficient.
It showed great promise as an ideal database system for Big Data applications,
but like anything else, it fell short due to some major drawbacks, as discussed
below. This is where NewSQL came alive. NewSQL is the latest development
in the world of database systems. NewSQL is a relational database with the
scalable properties of it.
Normalization
A process of designing efficient databases
What is NoSQL?
These problems became the impetus for the NoSQL movement in the mid-to-
late 2000s. The key working strategy is to forgo strong transactional guarantees
and relational models of DBMS in favour of eventual consistency and
alternative data models like key-value pairs and graphs.
This was done following the belief that these aspects of existing DBMSs inhibit
their ability to scale out and achieve the high availability needed to support web
apps on the go. The two most well-known systems that followed the creed were
Google’s BigTable and Amazon’s Dynamo, which were restricted to use inside
their organizations, leading to organizations creating their open-source clones
like Facebook’s Cassandra and Powerset’s HBase. By the end of the 2000s, a
diverse set of scalable and affordable DBMS existed.
Big Data Architecture helps design the Data Pipeline with the various
requirements of the Batch and Stream Processing System. Source: Big Data
Architecture
What is NewSQL?
The early counter-measures to the above approaches were a powerful single-
node machine that can handle all the transactions and a custom-built
middleware system to distribute queries over traditional DBMS nodes. But both
of them are prohibitively expensive to carry out. As a result, there was a need
for an intermediate database system that combines NoSQL systems' distributed
architectures with multiple node concurrency and a whole new storage
mechanism.
Thus Newsql can be defined as a class of modern relational DBMSs that seek to
provide the same scalable performance of NoSQL for OLTP workloads and
simultaneously guarantee ACID compliance for transactions as in RDBMS. In
other words, these systems want to achieve NoSQL's scalability without
discarding the relational model with SQL and the legacy DBMS transaction
support.
Concepts of NewSQL
Main Memory storage of OLTP databases enables in-memory
computations of databases.
Scaling out by splitting a database into disjoint subsets called partitions or
shards involves executing a query into multiple partitions and then combining
them into a single result.
Its systems preserve the ACID properties of databases.
Enhanced concurrency control system benefits traditional ones.
The presence of a secondary index allows it to support faster query
processing times.
High availability and Strong data durability are only possible with
replication mechanisms.
Configure its systems to provide synchronous updates of data over the
WAN.
It minimizes downtime and provides fault tolerance with its crash
recovery mechanism.
Yes, ACID
properties are No, rather provides for Yes, Acid properties
ACID
fundamental to their CAP support are taken care of.
application
SQL Support for SQL No support for old SQL Yes, proper support
and even enhanced
functionalities for Old
SQL
Fully functionally
It supports such
Inefficient for OLTP supports OLTP
OLTP databases, but it is not
databases. databases and is
the best suited.
highly efficient
Vertical + Horizontal
Scaling Vertical scaling Only Vertical scaling
scaling
Distributed
No Yes Yes
Databases
Types of Databases:
What Is a Database
A database is a systematically organized collection of data stored electronically, designed to
make it easier to store, access, manage and analyze information, including words, numbers,
images, videos, and files.
A “database” can also refer to a set of connected data accessed through a Database
Management System (DBMS), which is a software that allows users to interact with one or
more databases.
Because of the close relationship between them, the term “database” is often used casually to
refer to both a database and the DBMS used to manipulate it.
In simpler terms, a database is like a container that holds the information, while a DBMS is a
tool used to organize and manage the contents within that container.
To make things a little bit more complicated, the term “database” is often used informally to
denote the DBMS, the database system, or even an application connected to the database.
Moving forward, we will refer to the Database Management System (DBMS) as the
“database,” while the actual data stored will be referred to simply as “data.”
Tables: The fundamental blocks of a database structure are the tables, which consist
of rows and columns.
Rows and columns: A crucial aspect of the database structure is the rows and
columns. Rows show independent columns, whereas columns show attributes of those
records.
Primary key: A unique identifier for each record in a table.
Foreign key: A column that highlights a relationship between tables by referring to a
primary key in another table.
This structure ensures proper storage, management, and retrieval of your data, resulting in
smoother business operations.
Relational
Attribute NoSQL Databases
Databases
Structured, tabular
Data
schema, fixed data Schema-less, accommodates a variety of data types.
Structure
types.
Adhere to ACID
ACID properties for
Some sacrifice ACID compliance for performance and scalability.
Properties reliable
transactions.
Financial systems,
Use Cases CRM, e-commerce Social media, IoT, real-time analytics, big data applications.
applications.
*It’s worth noting that some databases, like MongoDB, can fall into multiple categories as
they support different data models. Additionally, the list provided is not exhaustive, as there
are many other databases available in each category.
Let’s take a deeper look into each database type, exploring its unique characteristics, real-
world applications, and practical considerations.
NoSQL Database: Offers flexible, schema-less structures for handling large volumes of
unstructured or semi-structured data. Examples include document-oriented, key-value, wide-
column, and graph databases, often used in big data and real-time applications.
Generally, databases are broadly categorized into relational (SQL) and non-relational
(NoSQL) systems, with organizations often choosing one or combining both, based on their
data and operational needs.
A relational database (RDB) is a method of organizing data into tables, rows, and columns to
show relationships between data points. This structure makes it straightforward to access,
create, read, modify, and delete data using a querying language—such as SQL.
Each table, also known as a relation, has rows (records) and columns (fields), where each row
represents an entity, and each column represents an attribute of that entity.
You can establish relationships between entities through primary and foreign keys by
guaranteeing data integrity and enabling complex queries.
Widely used in the financial industry thanks to the ACID properties that ensure data
reliability in financial transactions and support complex financial analysis.
In healthcare, relational databases are used to manage structured data such as patient
records, medical histories, and test results, aiding healthcare workflows.
Used to manage structured data such as customer, order, product, and payment data in
e-commerce.
NoSQL Databases
NoSQL databases use various data models for accessing and managing data. These databases
are optimized for applications needing flexible data models, handling large volumes of data,
and achieving low latency.
They accomplish this by relaxing some of the data consistency restrictions found in relational
databases, making them ideal for dynamic, high-performance applications that require
scalability and speed.
Instead of tables, NoSQL databases use more flexible data models, such as key-value pairs,
documents, or graphs. They offer scalability and flexibility, making them suitable for
handling large amounts of unstructured or semi-structured data. Examples include MongoDB,
CouchBase, Cassandra, and Redis.
Flexible and scalable, ideal for handling large amounts of unstructured or semi-
structured data.
Scale horizontally across multiple servers, making them highly scalable and fault-
tolerant.
Well-suited for use cases such as social media, e-commerce, and big data analytics.
Lack of standardized query language: each type of NoSQL database has its own
method for querying data, which can make these systems more challenging to learn,
integrate, and communicate with.
Not well-suited for complex transactions or querying relationships between data.
Social media platforms employ NoSQL databases to store and manage user-generated
content, facilitating efficient storage and processing of diverse content types.
In e-commerce, NoSQL databases are crucial for handling product recommendations
and customer analytics, enabling personalized recommendations and improved
customer experiences.
NoSQL databases excel in big data analytics, handling high-velocity and high-volume
data streams and extracting valuable insights from rapidly changing data sources.
When should I use a NoSQL database over a relational database?
A NoSQL database is a better choice than a relational database when you’re dealing with
large amounts of unstructured, semi-structured or rapidly changing data that does not neatly
fit into rows and columns.
NoSQL databases excel in use cases requiring high scalability, horizontal distribution across
nodes, and low-latency performance, such as real-time analytics, content management, and
IoT applications. They are particularly suited for scenarios involving schema flexibility, like
storing JSON documents or graph-based data, or when working with key-value pairs for
caching and session management.
Applications
NoSQL may fall short due to
requiring Relational databases are ideal for complex
limited or specialized query
complex queries requiring SQL, joins, and aggregations.
capabilities.
querying
System
Not ideal unless specific use Relational databases are the best choice for
handling
cases demand alternative structured, tabular data with predictable
structured,
models. relationships.
tabular data
Relational vs NoSQL Databases
SQL (Structured Query Language) and NoSQL (Not Only SQL) databases are fundamentally
different in how they are designed, how they store data, and how they are used.
However, these distinctions are not always clear-cut, and the choice of database ultimately
depends on your specific use case and requirements.
Structured, tabular
Data Schema-less accommodates
schema, fixed data Vector data
Structure a variety of data types.
types.
Typically scaled
Designed for horizontal
Scalability vertically (more CPU, Highly scalable
scaling (more servers).
RAM, SSD).
Graph Databases
Graph databases, a type of NoSQL database, are designed to handle complex relationships
between data points, making them ideal for use cases where relationships are as important as
the data itself, like in social networks or recommendation systems. They excel at representing
and querying graph-like structures, using nodes to represent entities and edges to represent
relationships. Popular examples include Neo4j, OrientDB, and ArangoDB.
Graph databases are used to track relationships between users on social networks
(friends, followers, etc.), model interactions (likes, shares, comments), and deliver
personalized content and recommendations. They are especially good at the “friend-
of-a-friend” types of queries that are common in social networks.
In e-commerce, they are used for handling product recommendations and customer
analytics.
In logistics, they are used for tracking shipments and optimizing routes. They can
handle the complex, multi-point routing requirements common in logistics and
delivery systems.
Document-Oriented Databases
Category within NoSQL databases, characterized by its schema-less design, where each
document (data record) can have a different structure and is typically stored in a format like
JSON or XML. This structure is highly flexible and adaptable to complex data structures.
Examples include MongoDB and CouchDB.