Marketing Analytics, Customer Lifetime Value, K Means Clustering, Probabilistic Models, Data Science.
categories. Grouping by Clusters #Grouping by clusters df_clusters = df_rftv.groupby(['cluster'])['CLV']\ .agg(['mean', "count"])\ .reset_index() df_clusters.columns = ["clusters", "avg_CLV", "n_customers"] df_clusters['perct_customers'] = (df_clusters['n_customers']/df_clusters['n_customers']\