# Modelling data with low observations of variable crosses

I apologies in advance as I am not sure on how best to formulate this problem in a generic manner, probably what is also stopping me finding anything of real value online.

I have the scenario where my data does not have a high number of observations between two variables, for example a website X advert, most of the data shows any given combination occurring only once from which it is impossible to build any model directly.

I would first like to learn what this type of problem is called when we have a low number of observation between two variables, and secondly some techniques to deal with such a dataset.

EDIT: I was asked to clarify my goal in a comment, the final task is to predict an outcome for this relationship of these two variables, I am modelling this as a binary classification problem.

• What is your goal ? Predict something ? Explain something? Estimate some quantity? – ArnoV Feb 23 at 13:41
• @ArnoV I added the final goal, yet the question was specifically a little looser than that as I am interested to learn more about the ways to handle this scenario in the data. – dendog Feb 23 at 14:13

The phrase you’re looking for is data sparsity.

What you’re modeling here is \$p(\mathrm{outcome} \mid \mathrm{website}, \mathrm{advert}). (Or, sure, you could model the joint distribution.) With sparse data, this can be challenging. You only have a few points from the joint space to look at.

How do we fix this? The go-to is to introduce some form of smoothing. This lets you leverage the observations you do have to help predict unseen observations. A common way is to compute features of the website and advert, which may be shared across observations. For instance, you could have “is this website about commerce?” as a binary (yes/no) feature. The simplest features are “identity features”—“is this website example.com?”, but you can see how this wouldn’t generalize.

When you provide these features to a model like logistic regression, information about things you’ve seen will inform predictions about things you haven’t.

I’m trying not to be too formal here, but it’s helpful to point out relevant terminology.

• Thanks @Arya I am already on this path, leveraging the words on the to this effect. How ever how do you apply smoothing to the score itself? eg; 1 observation of (url, ad) => 1 positive interaction, another combination may have many more observations and be a better true score between the two. – dendog Feb 23 at 17:23
• Sorry, I don’t understand your wording. Can you please clarify? – Arya McCarthy Feb 23 at 17:34
• Yeah sorry my bad, I think I was rushing! So the features from observations can be used to "smooth" as you suggest between examples, what do you suggest for the score/metrics, for example (url_a, ad_a) and (url_b, ad_b) both received a positive event, but you had seen the first combination once, but the second combination many times. The simple view is create a metric: pos_events / observations, but this skews towards low observation pairs. – dendog Feb 23 at 18:17