Predictive models with data that have elements inside them? I'm getting more experience in building predictive models like trees and random forests, but most of my experience is using data that is basically single observations (rows) with many variables (columns). How do I deal with making predictions about things that could potentially have a variable number of objects inside of it. Here is an example:
Say I want to predict if an insurance claim is fraudulent. That claim could contain several items inside of it. One claim could be one for theft of an Xbox and a television. Another claim could be for theft of 12 individual pieces of jewelry. The claims have claim level data like total amounts of losses to be paid, but there are also several individual level data elements inside with their own values and attributes. 
What is the best way to structure the data or model to make a prediction about the entire claim? Do I need a claim level variable called HasXbox? or HasJewelry? Do I need a variable like that for every possible item that could be in the claim?
 A: First things first, your model-building approach should be biased towards simplicity. What I mean is that it's entirely possible that your "best" model is one with only a few predictors, not 1000s. As a result, adding variables as specific as "HasXbox" is probably not the best approach to take.[1]  
My suggestion is to start with predictors such as:


*

*Number of items claimed

*Average price of items claimed

*Total claim size in $ (which would, in effect, function as an interaction term for first two)

*Max_Item_Price / Total_claim_size


and perhaps even some measure of spread, too. [Note: with random forests you can usually specify some sort of "importance" parameter which will rank the predictive power of each of your predictors. Hence, you can generate a handful of these types of predictors and then the software will do the trimming for you].  
Anyway, my point is that it's pretty easy to avoid the issue you're describing (i.e. of having a variable number of items per row) since--as you'll notice--every one of these predictors is defined regardless of whether the number of items claimed is 2 or 20 or more (you just have to be a little clever when defining your predictors).
Is this helpful??
[1] Note: I'm going to assume that you're dealing with a relatively manageable-sized dataset and are doing a regular Statistical analysis and not, in contrast, some super-complex data mining approach with terabytes of data at your disposal.
