Every business venture relies on customers, so it is crucial to comprehend their behaviour if businessmen want to be successful. The purpose of this study is to examine buying patterns by analyzing consumer behaviour. While existing systems for customer data analysis have produced valuable results, they lack the ability to categorize data into different parameters and often do not combine product and customer clusters in their analysis. This leads to ineffective targeting of consumers, resulting in wasted resources and time on inactive audiences. This study includes all important variables to produce the best results. The customer dataset is mined for useful insights using natural language processing and exploratory data analysis. In order to categorize clients and products on the basis of purchasing patterns in product categories, k-means clustering is utilized. Each client is given a cluster, which is determined by machine learning classifiers like logistic regression, SVM, KNN, and XGBoost. The top-performing classifier among these is the logistic regression classifier, which is further enhanced by using it in conjunction with the KNN approach and adding outlier detection to it. Businessmen can efficiently target particular customers by using segmented customer clusters to analyze their behaviour and purchasing patterns.