Suppose we have a list of products categorized into 10 categories. We also have customers order details such as

order_id, product_name, quantity, order_date

We want to know for a particular month what are the most probable categories from which customer might buy products. How can we approach this problem, Any suggestions.


I recommend using LSTM RNN or CNN algorithm to pick up the most popular product of on-going month based on the past purchasing history. I have created a working product ranking model for online shopping site lands'end in the United States.

In order to archieve the goal of this solution, you need to follow several steps.

  1. collecting the dataset

    I think you already gathered the dataset for this part.

  2. Processing of the dataset for supervised learning.

    • Cleaning up the dataset - please remove rows that contains NaN columns
    • mapping the products into eyes - you need to map the categories and products into row matrix with the element of 1 and 0.
    • Normalization - you need to rescale all real numbers into [0, 1]
    • split the dataset into the training, valid and test data.
  3. Build Deep learning model like LSTM RNN

    • select the deep learning framework. I recommend Tensorflow, Keras.
    • set the dimension of model. i.e. the number of layers, the number of neurons per layer.
    • optimizer, metrics
  4. Training the model and testing

  5. Get the predicted ranking of the category by monthly.

Protip: the most important thing to get the better result is which column would be set the output for ranking. You should sum up the total purchasing count per product or per category by month or week.

  • $\begingroup$ Thanks for your approach, seems good to me. But for now I am looking for a non deep learning approach. $\endgroup$ – arush1836 Apr 25 '18 at 5:41

From what you are describing, there is an independent variable (month, you can extract this information from order date) and the response variable which is the probability of purchasing a product of a particular category. You can use a simple Bayesian (Naive) algorithm for fitting a model and making a prediction for a specified month. You can not do much more than this.

But if you have available historical data for specific customer then you can build a recommendation system trying to make a profile for each customer and predict what is most probable to buy in a particular month. (Similarities among user or similarities among items)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.