DeepCTR icon indicating copy to clipboard operation
DeepCTR copied to clipboard

meaning of history_feature_list, self.history_feature_columns, self.sparse_varlen_columns

Open hwseo95 opened this issue 4 years ago • 1 comments

I have some questions about DIN parameters.

In the parameter description, history_feature_list indicate sequence sparse field, in your example code, it was ['item', 'item_gender']. So, self.history_fc_name = ['hist_item', 'hist_item_gender'].

In def init(self, ...): ...

     for fc in self.varlen_sparse_feature_columns:
          
          feature_name = fc.name
          if feature_name in self.history_fc_names:
              self.history_feature_columns.append(fc)
            
          else:
              self.sparse_varlen_feature_columns.append(fc)

... From this code, as I understood, self.history_feature_columns contains varlensparsefeats in history_feature_list and self.sparse_varlen_feature_columns contains varlensparsefeats not in history_feature_list. I want to know there is varlensparsefeats that will be in self.sparse_varlen_feature_columns. In your example code self.sparse_varlen_feature_columns is empty. what is the meaning of self.sparse_varlen_feature_columns in the algorithm?

hwseo95 avatar Mar 23 '21 01:03 hwseo95

self.sparse_varlen_feature_columns includes faetures that are not belong history behavior sequence but are varlen. for example the tags that user liked are sparse_varlen_feature

shenweichen avatar Jun 14 '21 04:06 shenweichen