I'm not a statistician but do work with large datasets and have a problem I'd like to use a predictive model for.
I have two datasets that I'd like to use together to build predictions. The first set is of a list of categories:
A, B, B, A, C, D, A, B, D , etc.
I have turned this into a table of histograms. Essentially, I have created categorical probabilities for each of the labels above. Let's call this distribution X.
The second set is a table with counts by source and category, here is a very simple example, though there are many more for each source:
source cat count
one A 19
one B 0
one C 10
one D 1
two A 0
two B 20
two C 1
two D 0
three A 100
three B 30
three C 57
three D 3
I've also created a distribution for each source, call this distribution Y. What I'd like to do is given cat A or cat B as a possible next entry, calculate which is more likely and with what margin of error. To do this I will use both the X and Y with a weight for each source:
Predicted_prob(cat A) = w * X(cat A) + (1 - w) * Y(cat A)
Here are some questions about this approach:
- Is this an ok general approach? I don't need anything super fancy, just something that can work with the data I have and give a way of measuring the confidence of the prediction.
- I am currently using a uniform distribution for w where w = (1 / n) and n is the number of samples of each source. Is there a better distribution that may work to make sure if n is too small, the effects are not felt as much?
I am working out the research in R but will ultimately need to implement with Python (can use RPy). I'm open to any theoretical or implementation input, as long as it's attainable!