I was facing some issue regarding how to use my data with the deepFM model (context aware) #2179
Replies: 1 comment
-
|
Hi! Thanks for providing such a clear description and your data structure that helps a lot. To use your dataset with the DeepFM model in Recbole, yes, you do need to convert all string-based fields into numerical format using the appropriate encoding. DeepFM expects all inputs to be tensors of numeric types (integers for categorical features). A few specific suggestions:
And then in your dataset.yaml, add: The error you're seeing: What to try: If you’d like, I can share a minimal working dataset config based on your example. Let me know, happy to help further! If useful, feel free to mark it as accepted! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My interaction data is like: (.inter file)
user_id:token,item_id:token,timestamp:float
f4a93710e172b32976144267e73d4b5e-242,257,1653480847.0
f4a93710e172b32976144267e73d4b5e-242,288,1653480877.0
f4a93710e172b32976144267e73d4b5e-242,214,1653480914.0
f4a93710e172b32976144267e73d4b5e-242,285,1653480929.0
and my .item data is like:
item_id:token,type:token,topics:token_seq,title:token,locale:token
20,toolkit,"[""Care Skills"", ""Dementia & Alzheimer's"", ""Developmental Disabilities"", ""Diabetes"", ""Emotions"", ""Future Planning"", ""Heart Health"", ""Hospice"", ""Lung Health"", ""Mental Changes"", ""Parkinson's"", ""Physical Changes"", ""Relationships"", ""Self-Care"", ""Stroke""]",Care Essentials,en
53,elearn,"[""Dementia & Alzheimer's"", ""Developmental Disabilities"", ""Falls"", ""Mobility"", ""Parkinson's"", ""Stroke""]",Moving & Transferring,en
So based on this if i want to use the deepFM model, do i need to use encoding and convert my string fields to numeric or can I directly use the data in this form in recbole?
I tried to use encoding for rest and multi encoding for 'topics' but I kept getting the error which I am not able to understand what the issue is even after encoding it:
new_data[k] = torch.LongTensor(value)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint64, uint32, uint16, uint8, and bool.
Beta Was this translation helpful? Give feedback.
All reactions