# Detect observations under certain conditions

I have a customer purchasing dataset and the data set is from a retailer having an online store and offline stores. So, customers have two options in their shopping channel, online or offline. In an online shopping, there is a shipping fee however if a basket size is larger than $50 there is no shipping fee. I found pieces of evidence that customers are trying to add some of items to make their basket size larger than$50 when their baskets are near and a little bit below the $50, because their shipping fee can be waived by doing that. • In this situation, I am trying to identify and characterize items that were purchased only because of the shipping threshold by using a machine learning algorithm. If there is no shipping threshold,$50, the customers would not purchase the items, but they purchased some items to make their basket size larger than $50. I have not observed those kinds of items (added items because of the shipping threshold). • Is there any machine learning algorithm that I can identify those kinds of items? I think I need to use some of unsupervised machine learning algorithm. Another challenging part is that each customer has different characteristics so I probably need to consider it as well. How can I detect those kinds of items?? ## 1 Answer Since my comment would not fit, I'll answer the question. • I think this problem will be even more better solved if you have the web data as well. Say after adding the required necessity in the cart the customer will check the total amount. And if it is below 50$, the person will add some more items. So checking this can give you a better clue.
• Another data you must have for better guessing is the order in which the person has added items to his cart. This will also provide you an important clue about the cheap items the customer is adding to cart to try to cross the minimum threshold.
• You will also have to segregate cheap items from pricey ones for a customer. This data with the above 2 approaches is a definite giveaway.
• This might be a personal opinion, but whenever I need to cross the shipping fee threshold I usually add items which I have already bought the previous time to escape shipping fee. You will need more data to see if this is true in most cases.
• And if you don't have any of the above data, the pure Machine Learning approach would be to pick an item which is costly and somewhat popular and an item which will string together people with likewise interests. Say, a great book on ML is this item. You find out all the customers who bought this book. Check all the similarities between all the other things bought by the customer, like say one customer adds a book on AI after this while another buys a book on python. So these are related by computer science. Go on until you find all the things that are generally dissimilar between all the customers, since now they are buying to cross the threshold and each will buy according to his own requirements without a common interest in mind. There you have all the data you need.
• Or you can use the converse of this approach, find a non-significant thing like sugar. String together all the customers who bought this item. Check their interests to see if it has anything to do with sugar. If not send them to one group. Now in this group, match the interests of the customer on other items, if dissimilar you get a good idea that this item was bought to cross threshold.

I understand this is a kind of opinionated answer. But I think these are trade secrets not revealed by companies. so you have to figure out algorithms yourself. Also, simple machine learning won't work, lots of logical programming is also required. And I also think you need to have a good understanding of human psychology works. You can interview your friends and family about what they would do and get a general intuition. Hope this helps!