Posts

When doesn’t an RFM segmentation work well?

Image
  First step to understand various customer characteristics is to build a segment. Many methodology has been created and the most simple yet very useful segmentation type is RFM segmentation. R stand for  Recency , meaning the number of time units that have passed since the customer last purchase. F stand for  Frequency , the number of purchase per time unit and M stand for  Monetary , the total amount spent per time unit. The order of RFM is also NOT without meaning. The most recent (R) customer who made transaction is more valuable compared to customer who transacted few unit time ago. From this three metrics, a cut off value based on value is determined to decide which cluster does a customer belongs to. This segmentation is very simple, but is there any catch regarding the methodology? Supposed we already decide a unit time cut off as the metrics of R, and observed the relationship between frequency and monetary. In a case when the price and quantity variance of ...

Easy Data Understanding Using pandas_profiling

Image
  How do you usually explore new dataset? By checking the file and the column one by one. The checking include: a. Number of column and row b. Data type of each column c. Missing data in each column d. Distribution of each column e. Correlation between column This checking task is tedious, especially if we have data where we have a lot of columns and rows. I was just encounter a python package called “pandas_profiling”. We can easily install the package using pip or conda conda install - c anaconda pandas - profiling   pip install pandas - profiling Here are some example. Data was downloaded from Kaggle https://www.kaggle.com/hmavrodiev/london-bike-sharing-dataset Reading the data and explore using pandas profiling 1 2 3 4 # Importing package import pandas as pd #or from pandas_profiling import ProfileReport 1 2 3 # Reading csv data london = pd.read_csv( 'london_merged.csv' ) london.head() 1 ProfileReport(london) Source: https://stackoverflow.com/questions/49314314/unable-...

Error Loading pandas_profiling

Image
  Pandas profiling is good, but sometimes install and make it ready to use is a hassle. Here is one error that I was encountered when I use pandas_profiling cannot import name 'GridspecLayout' from 'ipywidgets' From stackoverflow, I need to install ipywidgets version 7.5 Installing it and it works fine. Here are sample result from my previous blog post https://staesthetic.wordpress.com/2020/01/27/easy-data-understanding-using-pandas_profiling/ Source: https://stackoverflow.com/questions/56953612/importerror-cannot-import-name-applayout-from-ipywidgets