Skip to main content

Correlated Cross-Occurrence (CCO): How to make data behave



Cross-occurrence allows us to ask the question: are 2 events correlated.

To use the Ecom example, purchase is the conversion or primary action, a detail page view might be related but we must test each cross-occurrence to make sure. I know for a fact that with many ecom datasets it is impossible to treat these events as the same thing and get anything but a drop in quality of recommendations (I’ve tested this). People that use the ALS recommender in Spark’s MLlib sometimes tell you to weight the view less than the purchase. But this is nonsense (again I’ve tested this). What is true is that *some* views lead to purchases and others do not. So treating them all with the same weight is pure garbage.

What CCO does is find the views that seem to lead to purchase. It can also find category-preferences that lead to certain purchases, as well as location-preference (triggered by a purchase when logged in from some location).  And so on. Just about anything you know about users or can phrase as a possible indicator of user taste can be used to get lift in quality of recommendation.

So in the example below purchase history is the conversion action, likes, and downloads are secondary actions looked at as cross-occurrences. Note that we don’t need to have the same IDs for all actions. 

BTW to illustrate how powerful this idea is, I have a client that sells one item a year on average to a customer. It’s a very big item and has a lifetime of one year. So using ALS you could only train on the purchase and if you were gathering a year of data there would be precious little training data. Also when you have a user with no purchase it is impossible to recommend. ALS fails on all users with no purchase history. However with CCO, all the user journey and any data about the user you can gather along the way can be used to recommend something to purchase. So this client would be able to recommend to only 20% of their returning shoppers with ALS and those recs would be low of quality based on only one event far in the past. CCO using all the clickstream (or important parts of it) can do quite well.

This may seem an edge case but only in degree, every ecom app has data they are throwing away and CCO addresses this.


A way to compare 2 events at the individual level. The comparison is called the Log-Likelihood Ratio or LLR. This would allow us to look across all page views and see which correlated with which purchases. , not all page view are created equal but we now had a way to find the important ones!

Comments

Popular posts from this blog

Python and Parquet Performance

In Pandas, PyArrow, fastparquet, AWS Data Wrangler, PySpark and Dask. This post outlines how to use all common Python libraries to read and write Parquet format while taking advantage of  columnar storage ,  columnar compression  and  data partitioning . Used together, these three optimizations can dramatically accelerate I/O for your Python applications compared to CSV, JSON, HDF or other row-based formats. Parquet makes applications possible that are simply impossible using a text format like JSON or CSV. Introduction I have recently gotten more familiar with how to work with  Parquet  datasets across the six major tools used to read and write from Parquet in the Python ecosystem:  Pandas ,  PyArrow ,  fastparquet ,  AWS Data Wrangler ,  PySpark  and  Dask . My work of late in algorithmic trading involves switching between these tools a lot and as I said I often mix up the APIs. I use Pandas and PyArrow for in-RAM comput...

Kubernetes Configuration Provider to load data from Secrets and Config Maps

Using Kubernetes Configuration Provider to load data from Secrets and Config Maps When running Apache Kafka on Kubernetes, you will sooner or later probably need to use Config Maps or Secrets. Either to store something in them, or load them into your Kafka configuration. That is true regardless of whether you use Strimzi to manage your Apache Kafka cluster or something else. Kubernetes has its own way of using Secrets and Config Maps from Pods. But they might not be always sufficient. That is why in Strimzi, we created Kubernetes Configuration Provider for Apache Kafka which we will introduce in this blog post. Usually, when you need to use data from a Config Map or Secret in your Pod, you will either mount it as volume or map it to an environment variable. Both methods are configured in the spec section or the Pod resource or in the spec.template.spec section when using higher level resources such as Deployments or StatefulSets. When mounted as a volume, the contents of the Secr...

Andriod Bug

A bug that steals cash by racking up charges from sending premium rate text messages has been found in Google Play.  Security researchers have identified 32 apps on Google Play that harbour the bug called BadNews. A security firm Lookout, which uncovered BadNews, said that the malicious program lays dormant on handsets for weeks to escape detection.  The malware targeted Android owners in Russia, Ukraine, Belarus and other countries in eastern Europe. 32 apps were available through four separate developer accounts on Google Play. Google has now suspended those accounts and it has pulled all the affected apps from Google Play, it added. Half of the 32 apps seeded with BadNews are Russian and the version of AlphaSMS it installed is tuned to use premium rate numbers in Russia, Ukraine, Belarus, Armenia and Kazakhstan.