I'm playing with a "minor" variation on an otherwise typical low rank matrix factorization collaborative filtering algorithm. I'm mostly following Andrew Ng's description in Coursera's online ML course - with this "minor" variation.
I'm given:
- A reasonable amount of user preference data
- A sparse feature data set
I want to compute the User parameter vectors (Theta), using the provided feature data, and use them to predict the full set of user preference values.
Example:
UserA UserB UserC ... UserN | Feature1 F2 F3 F4 F5 F6 ... FN
item_1 0 5 ? ? | 1 0 NA NA NA NA NA
item_2 1 ? ? 5 | NA NA 1 1 NA NA NA
item_3 5 0 2 0 | NA NA NA NA 0 1 0
... |
itemN 0 0 5 0 | 0 1 NA 1 NA NA NA
Not all features apply to all items. Each item has 10-100 features worth of applicable data, out of a total of say 1000 features.
My question is how I should process the NA (Not applicable) features. Most of the feature data is boolean (and where it isn't, presume it's normalized).
- Should I treat the NA's as 0's (false)?
- Should I give NA's their own, otherwise unused (-1) value?
- Or am I wading into dangerous territory with this modification to the typical format of the algorithm.
- Perhaps an approach I'm not thinking of?
Data/problem example:
- Item #1 is a shape. A green square to be specific.
- Item #2 is a feeling. A blue sadness (we're associating colors with feelings these days)
Our feature set then is:
x0 x1 x2 x3 x4 x5 x6 x7 x8
isSquare isCircle isTriangle isHappy isSad isRed isGreen isBlue
item#1 1 1 0 0 NA NA 0 1 0
item#2 1 NA NA NA 0 1 0 0 1
For most items we've got good quality feature data like this, sure, we'd like to make use of user preference data to help us improve our feature data, but for the most part we want to derive user preferences from existing feature data.
Hence I'm trying to implement the process of calculating preference data from features separately from calculating features from preferences, in hopes of controlling that process where I know the feature data is highly accurate (but still being able to learn feature data that might be inaccurate or to identify questionable assumptions in the feature data).
I'd like to play with the process some to see how a few assumptions I have play out. But I'm perplexed by the NA's in my feature set.
My best thought so far is that they're just 0's, as a feeling "is NOT a circle", which is essentially a true statement, as irrelevant as the comparison might be.