Classification using the Tree-based method in R

Classification using the Tree-based method in RMario CamachoBlockedUnblockFollowFollowingDec 13One of the biggest problems in different industries is the classification of customers to create more segmented marketing campaigns.The importance of a segmented marketing campaign is the ability to get a better conversions rate, which can become a real challenge.Following the previous idea, through this article, we are going to make an introduction of how to use the decision tree method for the classification of customers, users, and publications in R.First of all, it is important to understand the concept and purpose of using a “Decision Tree Method”..The tree-based method segments an observation in a number of regions, to make this prediction it uses the mean or the mode of the training observations in the respective region..For example, a tree-based method could help us to segment a customer by their qualitative variables, like income, age, gender, preferences, helps us see different relations that we can’t see by observing the data.For example, with a Facebook dataset in which there are 500 publications on Facebook of a cosmetics company with the following data of likes, shares, comments and the most important, a variable name “category”, which we don’t know what it’s meaning.figure 1 Facebook dataset in RFirst of all, we need to understand how to identify the variables that determine each category.As a first step, we clean the data by deleting de NA fields using the following code.It is important to install our package by naming it “tree”, in this case, in order to start making our classification tree.Once the classification tree is installed we have to create it, following the next code..This code will let us change our “Category” variable as a factor, additionally, it let us delete all the other categorical variables and the numerical variable name “total interactions”.Finally, we plot it and get Figure 2.figure 2 Classification Tree for the Category VariableFinally, we can conclude that when the publication gets fewer numbers in their interactions, the category would be 1, with more interactions and users the category would be 2 or 3..By these terms, we can understand how the publications are classified in the category variable.In conclusion, this is one method to make the classification of users, customers, publications, it’s really helpful to segment our marketing campaign, like in our example, we can classify our publications and see which ones are getting more engagement with the Facebook user.Later on, I will be writing about other classification methods, let me know if you like to know about a specific method and any other conclusion you could get in the comment section.. More details

Leave a Reply