Posts

Showing posts from April, 2024

Customer Segmentation Using R Programming

Image
 Customer Segmentation Using R Programming 1. IMPORT DATA data <-read.csv("C:/Users/aishw/Downloads/train-set.csv") head(data)   str(data)   summary(data)       This R code explores a CSV file. It reads the data (read.csv), previews the first few rows (head), examines the data structure (str), and summarizes the data (summary) to give you a quick understanding of what you're working with before further analysis. 2. DATA PREPROCESSING {r} cleaned_data <- data[complete.cases(data), ] print("Cleaned Dataframe:") print(cleaned_data) data=cleaned_data This code cleans the data by removing rows with missing values and then replaces the original data with the cleaned version. This is often a crucial step in data analysis, as missing values can lead to errors or inaccuracies in calculations and modeling. By cleaning the data, you ensure a more reliable foundation for further analysis. 3. K-MEANS CLUSTERING {r} if (!is.data.frame(data)) {  ...

Customer Segmentation Using Python

Image
 Customer Segmentation Using Python Image source: Pixabay 1. DATA SET DESCRIPTION Customer segmentation is one of the most integral parts of marketing. Customer segmentation refers to the process of dividing the entire customer base into groups based on certain characteristics like age, income, geography, spending habits, and more. The variables in the dataset are: CustomerID  : unique customer ID Gender  : gender of the customer Married  : marital status of the customer Age  : age of the customer Graduated  : specifies whether the customer is a graduate Profession  : the profession of the customer WorkExperience  : work experience of the customer in years SpendingScore  : spending score of the customer FamilySize  : number of family members of the customer (including the customer) Category  : anonymized category for the customer Segmentation  : (target variable) customer segment of the customer The data set can accessed throug...