Geek Culture
Published in

Geek Culture

Types of Variables in Data Science!

This blog aims towards explaining all of the types of available variables in the Data Science field with examples.

Source

In the field of Data Science, there has been a trend that most people say that they are data scientists, or they have explored a lot in the fields of Data Science, Machine Learning, Deep Learning, & as well as statistics. But, to the horror of the people who have actually explored, when they meet or discuss with most of the other people, they found that even the basics of those people are not clear.

This approach of directly jumping into the complex topics & having an overview of them will never lead to success especially in the field of Data Science. Therefore, to excel in this field, it is very important to have the right concepts.

So, that being said, let’s proceed with the blog that aims to explain a subpart of the right fundamentals of Data Science i.e. Types of Variables.

Types of Variables in Data Science!

In totality, there exist 4 types of variables in the field of Data Science which are listed below:

  1. Numerical
  2. Categorical
  3. DateTime
  4. Mixed

Understanding the type of variable is very much important to choose the corresponding processing technique for that in Data Science.

Now, that being said, let’s proceed towards the explanation of each type of variable.

Numerical Variables

This is the category of variables that deals with the numbers only. This category can be further divided into 2 sub-categories.

  1. Discrete
  2. Continuous

Based on the value of the numerical variable, it can be sub-categorized into Discrete or continuous.

Discrete Numerical Variable

This is the category of the variables that only contain a discrete quantity, that is integers. No fractions are allowed in this category.

Few examples of this category are:

  1. Whole numbers or Natural Numbers
  2. The number of laptops you own, (here you will definitely have an integer as an answer, no one can say that it has 1.1 laptops, it will be obviously 1, 2, 3, etc.)
  3. The number of shirts you have.
  4. The number of houses you own.
  5. The number of vehicles you own.
  6. The number of children in the family.
  7. The number of pets in the family.
  8. The number of bank accounts one has. 💰
  9. The number of relationships someone has. 😳💕

and many more…

Continuous Numerical Variables

This is the category of the numerical variables that deal with the continuous quantities or fractional quantities.

Few examples of this category are:

  1. The amount of your postpaid mobile bill. (Generally, it is not an integer, it is like 500.50, etc)
  2. Total time spent on watching a web series (120.5 seconds, etc)
  3. Total amount spent on ordering food online (1500.57 INR, etc)
  4. The interest rate on loan.
  5. Weight of an individual. (It is not always an integer, mostly it is like 90.5 kg, etc)

and many more…

These are the type of variables that falls under the category of the Numerical variables.

Categorical Variables

This is the category of the Variables that deals with the categories. It is also divided into 2 subcategories.

  1. Ordinal
  2. Nominal

Based on the value of the categorical variable, it can be sub-categorized into Nominal or Ordinal.

Ordinal Categorical Variable

Those variables that have an order associated with them are known as Ordinal Categorical variables or categorized into Ordinal Categorical Variables. The order is just been observed in the values that a particular variable is holding.

Few examples of this category are:

  1. Days of the week (here there is a specific order => Monday always comes before Tuesday and so on…)
  2. A particular Car series of any most popular companies like Audi, etc. Here, the car model is associated with a specific price, therefore based on the model of the car, we can categorize the car series in an order of either ascending or descending price bracket.
  3. Educational Degrees (Ph.D. always comes after master's degree & so on…)
  4. Grades obtained in college.
  5. Steps to create a mobile phone. (This process definitely has ordered steps that cannot be altered.)

and many more…

Nominal Categorical variables

Those variables that do not have any order associated with them are known as Nominal Categorical variables or categorized into Nominal Categorical Variables.

Few examples of this category are:

  1. Country Names
  2. City Names
  3. Sex / Gender
  4. Operating Systems
  5. Display Types (Retina, IPS, AMOLED, etc)

and many more…

These are the type of variables that falls under the category of the Categorical variables.

Note (Insight): There are very few people who know that categorical variables can also contain numbers, they do not always contain strings. For example, The class of plane or train in which you are traveling. There can be first class, second class, etc. of AC in the train, whereas different classes like economy, business, etc for plain can be first encoded & then they will be in numerical order & still be a categorical variable (ordinal categorical variable to be precise).

DateTime Variable

This category of variable deals with the date & time aspects. This category can contain the type of values mentioned below:

  1. Only having a date.
  2. Only having time.
  3. Having both date & time.

Few examples of this category are:

  1. Birthdate
  2. Time of boarding the plane
  3. Timestamp
  4. Time on which the log of the system is generated.
  5. Date of Application.
  6. Date of Graduation.
  7. Date of ordering a product online.

and many more…

These are the type of variables that falls under the category of the DateTime variables.

Mixed Variables

This category of variables deals with a collection of multiple values for the multiple observations of a specific variable. This category can also be divided into 2 different categories mentioned below:

  1. Numbers or labels/strings in different observations.
  2. Numbers & Labels/strings in the same observation.

Examples of category 1:

  • The number of credit cards a person owns ( The value of this variable can be either a number for some observations, & also it can be “unknown” for some other observations due to any reason, therefore, it includes numbers and strings for the different observations).
  • Performance of a student (Here someone can mention the CGPA, percentage, or grades also, which includes numbers as well as labels/strings).

and many more…

Examples of category 2:

  • Cabin Number (A1, C3, E5, etc)
  • Vehicle Registration Number

and many more…

These are the type of variables that falls under the category of the Mixed variables.

Having a good understanding of these types & subtypes of the variables provides the options to choose a processing technique for these variables, as well as based on the different types of variables, different types of insights can be obtained from them.

I hope my article explains each and everything related to the topic with all the detailed concepts and explanations. Thank you so much for investing your time in reading my blog & boosting your knowledge. If you like my work, then I request you to applaud this blog & follow me on Medium, GitHub, & LinkedIn for the more amazing content on multiple technologies and their integration!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store