Data schema
This recipe uses XDM schemas to model the data. The schema used for this recipe is shown below:
Field Name | Type |
---|---|
userId | String |
genderRatio | Number |
ageY | Number |
ageM | Number |
optinEmail | Boolean |
optinMobile | Boolean |
optinAddress | Boolean |
created | Integer |
totalOrders | Number |
totalItems | Number |
orderDate1 | Number |
shippingDate1 | Number |
totalPrice1 | Number |
tax1 | Number |
orderDate2 | Number |
shippingDate2 | Number |
totalPrice2 | Number |
Algorithm
First, the training dataset in the ProductPrediction schema is loaded. From here, the model is trained using a random forest classifier. Random forest classifier is a type of ensembled algorithm which refers to an algorithm that combines multiple algorithms to obtain improved predictive performance. The idea behind the algorithm is that the random forest classifier builds multiple decision trees and merges them to create a more accurate and stable prediction.
This process starts with creating a set of decision trees that randomly selects subsets of training data. Afterwards, the results of each decision tree is averaged.
Previous pageProduct recommendation recipe
Next pageRetail sales recipe