I will upvote.
Using Python please.
Use ANY customer.csv dataset.(I cant provide link due to answers
policy) and (I only need the solution so dataset does not
matter.
1 import seaborn as sns 2 import numpy as np 3 sns.set(style='whitegrid', palette="deep", font_scale=1.1, rc={ "figure.figsize": [15, 10]}) 4 import matplotlib.pyplot as plt 5 import pandas as pd U 1 **************** 2 # Programmer Name: 3 # class: CIS4321, Spring 2022 4 # Programming Assignment 5 # Date: 6 # 7 # 8# Description: 9 ********************************************** Background In this assignment use customer_data.csv, you will conduct data mining analysis on customer data which have basic data like age, gender, annual income in k$ and spending score. The goal of this assignment is to identify customer cluster 'segments' using K-Means Clustering in order to gain insight which customers segments should the company target for marketing. 1. Import customers.csv into customers_df U 1 # solution
2. Select columns Income and Spending into x U 1 # solution 3. Scale the data using Standard Scaler and output the results to scaled_x U 1# solution 4. Run PCA on X and output the results in x_pca U 1 # solution 5. Run silhouette analysis and select the optimum n_clusters U 1 # solution 6. Run KMeans with optimum K and predict the output into cust_km_output U 1 # solution
7. Join the X_pca and cust_km_output into one data frame x_pca_df and name the predicted column as 'cluster' 1 # solution 8. Run the pair plot on X_pca_df, color the data points by their clusters and interpret the plot. U 1 # solution 9. Join the X pca_df with the original data frame customers_df and plot a scatter plot of Income vs Spending and color the data points by their clusters. Discuss the plot results. U 1# solution - 10. Create a summary table (sample below) and fill the value with the median value for each group. Hint: Use groupby function. Age Income Spending cluster Gender Female Male
1 import seaborn as sns 2 import numpy as np 3 sns.set(style='whitegrid', palette="deep", font_scale=1.1, rc={ "figure.f
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
1 import seaborn as sns 2 import numpy as np 3 sns.set(style='whitegrid', palette="deep", font_scale=1.1, rc={ "figure.f
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!