Shimoku docs
Search…
Retention suite

In a nutshell

Just specifying the key column names, Shimoku will create a whole Retention Suite in less than 48 hours.
shimoku.suite.retention_suite(
data=data,
customer='customer_id',
date='date',
business_type='transactional',
)
Where business_type could be transactional for Retail-like businesses or subscription for subscription businesses.
For retail, you may want to add also the product column for the recommender system
shimoku.suite.retention_suite(
data=data,
customer='customer_id',
product='product_id',
date='date',
business_type='transactional',
)

On the data

The minimum dataset for Shimoku to make predictions must contain
  • date column as timestamp
  • customer_id column as the customer unique identifier
  • product_id as the product identifier for Retail-like businesses
Nevertheless the more data you add the more will learn the algorithm, in particular, we suggest to add as much data as possible, being the ideal case the Shopify Order object

Updating

The first time you have to update at least 12 months of data. Nevertheless, after you post the historic dataset you can count on updated predictions just posting the daily lambdas by specifying how='append'
historic_dataframe = pd.read_csv('historic_orders.csv') # Orders from the last 12 months
shimoku.suite.retention_suite(
data=historic_dataframe,
customer='customer_id',
product='product_id',
date='date',
business_type='transactional',
)
yesterday_df = pd.read_csv('yesterday_orders.csv') # orders from yesterday
shimoku.suite.retention_suite(
data=yesterday_df,
customer='customer_id',
product='product_id',
date='date',
business_type='transactional',
# to tell Shimoku SDK that this is a piece of data
# to be concat to the historic one
how='append',
)

Full example

Including the Class instance call
api_key: str = getenv('API_TOKEN')
universe_id: str = getenv('UNIVERSE_ID')
business_id: str = getenv('BUSINESS_ID')
environment: str = getenv('ENVIRONMENT')
config = {
'access_token': api_key,
}
shimoku = shimoku.Client(
config=config,
universe_id=universe_id,
environment=environment,
)
shimoku.plt.set_business(business_id=business_id)
shimoku.suite.retention_suite(
data=data,
customer='customer_id',
product='product_id',
date='date',
business_type='transactional',
)
Copy link
On this page