Every topic starts at New. Sign in and your practice counts.
In data science we can mainly classify data into two main types qualitative(categorical) and quantitative(numeric).
Qualitative or Categorical data describes an object or a group of objects that can be labeled according to some group or category. It cannot be represented in numerical form. For example, data including colors, places, etc. it is further subdivided into two types:
i. Ordinal data
ii. Nominal data
Ordinal Data:
Ordinal data sees a specific order or ranking, it uses certain scale or measure to group data into categories. Such as in test grades, economic status, or military rank.
Nominal Data:
Nominal data does not have any order, it can be labelled into mutually exclusive categories, which cannot be ordered meaningfully. For example, if we consider the categories of transportation as car, bus or train. Similarly, gender, city, color, employment status are also examples of nominal data.
Quantitative or Numerical data deals with numeric values, that can be computed mathematically to draw some conclusions. Examples of numeric data are height, weight, number of students in a school, fruits in a basket etc. Quantitative data can be further divided into two types:
i. Discrete data
ii. Continuous data
Discrete Data: It includes data which can only take certain values and cannot be further subdivided into smaller units. This data can be counted and has a finite number of values. For example, the number of product reviews, ticket sold, computers in certain departments, employees in a company etc.
Continuous Data: It refers to the unspecified number of possible measurements between two realistic points or numbers. For example, daily wind speed, weight of newborn babies, freezer's temperature etc.
Continuous data is further subdivided into two types:
Interval Scaled data: In this type of data the differences between consecutive measurements are equal, but there is no true zero point. For example, Temperature in Celsius or Fahrenheit (0°C or 0°F) does not mean the absence of temperature. Interval scaled data can be added, subtracted and compared.
Ratio scaled data: In this type of data the differences between the consecutive measurements are meaningful. There is a true zero point in this sort of data. For example, 0 Kg means absence of weight. This data can be added subtracted and compared.
To analyze data for predictive analysis and decision making, the initial step is data collection through various reliable sources. Data can be divided into two categories, primary data, and secondary data. Primary data is collected directly by questionnaires, surveys, and interviews. Primary data can also be collected through experiments and recording observations. secondary data is collected from some previously recorded from primary data. Following are some sources of data:
Website: Collecting tweets regarding some topic or thread.
Surveys: Collecting firsthand data by performing surveys about some event, movie, or anything else.
Sensors: Collecting seismic data regarding changes under the earth which cause earthquakes.
A dataset is a structured or organized collection of data, which is usually associated with a unique body of work. However, a database is an organized collection of data stored in multiple datasets or tables. These tables can be accessed electronically from the computer system for further manipulation and update.
To perform actions on the data stored in a database, we need a Database Management System (DBMS). DBMS is the interface between the database and the end user, providing a platform to create, modify, and retrieve data. There are many different database management systems available, depending on the type of database being used.
For example, relational databases, which store data in tables, can be managed by database management systems such as MySQL, Oracle, MSAccess and IBM Db2. These are the most used databases in Data Science, for the data which is
This figure is being prepared.
Dataset and Database
presented in a tabular format. Non-relational databases, which store data in forms such as key-value pairs, column families, or graphs, can be managed by database management systems like MongoDB and Cassandra. Non-relational DBMS are also called NoSQL DBMS.
To further understand, how database is helpful to store data, consider online shopping websites. The products shown on the websites are stored in a database. To manage the products, customers and their orders a specific database is maintained. The following is the structure of an online website database:
Tables: Product, Customer, Orders
We can display each table as follows:
Product Table
Before the advent of database systems, computer scientists relied on file management systems to store and manage data. However, without a structured method of storing data, it would be of little use. This is why databases were introduced to manage and store large amounts of data. The first database management system was developed in 1960s.
There are two key reasons why databases have become so popular in recent years:
To better understand the importance of databases in our daily lives, let's take an example of supermarkets' evolution. In this case study you will learn how data science had impact on the shopping in current age.
Case study for the use case of Database and Data Science
In the old days, people used to buy their necessities from various shops. For example, if you had to buy a calculator, a box of yogurt, shoe polish and a pair of socks of school uniform, you were supposed to visit four various shops. Such shopping was never an enjoyable experience because shops often had less space for customers, and they had to wait for the shopkeeper to find their desired item. The introduction of supermarkets, however, changed that, as they made shopping much more pleasant by displaying all the products in a large space and making them easily accessible to customers. As the number of products and customers in supermarkets increased, the need for a database system to keep track of all the purchases became critical.
Data Science plays a crucial role in determining the place of various products in various shelves of the supermarket. For example, the information gathered from the database will guide us to place the products with less shelf life in the most easily accessible shelves. Similarly, predictive analysis provides adequate guidelines that which products would be in high demand in which season/month. For example, in Pakistan during the months of religious and national festivals, the demand of food items and clothing increases as compared to the rest of the year. By analyzing sales data from different supermarket branches, supermarket owners can identify which products need to be stocked in larger quantities and during which months the sales are highest.
Data Collection is the process of collecting information from relevant sources to find a solution to the given statistical enquiry. Collection of Data is the first and foremost step in a statistical investigation. Data collection methods are divided into two categories:
i. Primary data collection
ii. Secondary data collection
Primary data collection methods:
It involves the collection of original data directly from the data source or via direct interaction with the respondent. A respondent is a person from whom the statistical information required for the enquiry is collected. Some common primary data collection methods are as follows:
i. Surveys and Questionnaires
ii. Interviews
iii. Observations
iv. Experiments
v. Focus groups
vi. Sensors
vii. IoT devices
viii. Biometric devices
Secondary data collection methods:
It involves data collection using existing data collected by someone else for some purpose. Such data is usually available in the form of published material like research papers, books, websites etc. Some common secondary data collection methods are as follows:
i. Published sources
ii. Online databases
iii. Government and institutional records
iv. Surveys and Questionnaires conducted in the past
v. Social media data/posts
vi. Publicly available data
vii. Past research studies
After data collection, effective storage of data is an essential step for managing and analyzing the large volumes of data. There are various data storage methods according to the nature of data. Some common data storage methods are as follows:
i. Relational/NoSQL databases
ii. Data warehouse
iii. Distributed file systems
iv. Cloud based data storage
v. Blockchain
Data visualization is graphical representation of data to get meaningful insight, trends, and patterns from data. The visual elements which help in data visualization are charts, graphs, maps, figures, and dashboard etc.
It is information about the data in a sample. It can help understand the values better. It may include the total number of values, minimum value, and maximum value, along with the mean value and the standard deviation corresponding to a data
collection. Summary statistics help to understand the trends, outliers, and distribution of values in a data set.
The summary statistics provide a quick overview of characteristics of data. It leads towards a better understanding of data cleaning, data preprocessing, feature selection and data visualization.
| Product ID | Product Name | Price | Stock Quantity | Expiry Date |
|---|---|---|---|---|
| Pd001 | Chocolate 50Gm | Rs. 250 | 700 | June 2026 |
| Pd002 | Honey 500Gm | Rs. 1000 | 150 | December 2027 |
Customer Table
| Cust. ID | Customer Name | Email ID | Contact Number | Address |
|---|---|---|---|---|
| Cust001 | Ali Ahmad | ali@gmail.com | 03901597535 | 152 main road Islamabad |
| Cust005 | Shagufta Asad | sasad@gmail.com | 03624569852 | 78 DHA Phase-II Karachi |
Order Table
| Order ID | Cust. ID | Product ID | Qty. | Order Date | Status | Payment |
|---|---|---|---|---|---|---|
| Os987 | Cust005 | Pd002 | 2 | 4 February, 2025 | Pending | COD |
| Os873 | Cust001 | Pd002 | 5 | 6 February, 2025 | Shipped | Paid |
The customers visit the website, choose the desired product/products and add them to the cart. They select quantity and mode of payment and place the order. In this way, the database is helpful and provides ease of product and order management for the website. Some other examples of databases are school library system, hotel management system, student management system etc.
To determine the months with the heaviest customer traffic, a graph was plotted between the month and gross income. The analysis showed that the sales were highest in the months of festivals. In this way data science provides maximum benefits to the supermarket owners as well as customers, who can find their desired items easily.
| Month | Food Items | Clothing and Footware |
|---|
Fig. 4.4 Monthly income of all the supermarkets in a small town in Pakistan