def treat_interactions(self): for num, interaction_file in enumerate(self.list_train_files): interaction = ReadFile(interaction_file, space_type=self.space_type) interaction.triple_information() self.individual_datasets.append(interaction.triple_dataset) self.final_dataset += interaction.triple_dataset self.dict_item, self.dict_not_item, self.list_users, self.list_items, \ self.dict_index = return_list_info(self.final_dataset) self.list_users = list(self.list_users) self.list_items = list(self.list_items)
def treat_interactions(self): for num, interaction_file in enumerate(self.list_train_files): interaction = ReadFile(interaction_file, space_type=self.space_type) interaction.triple_information() self.individual_datasets.append(interaction.triple_dataset) self.final_dataset += interaction.triple_dataset if num + 1 == len(self.list_train_files): for triple in interaction.triple_dataset: self.dict_item_tag[triple[0]] = self.dict_item_tag.get( triple[0], 0) + 1 self.dict_item_tag[triple[1]] = self.dict_item_tag.get( triple[1], 0) + 1 self.dict_item, self.dict_not_item, self.list_users, self.list_items, \ self.dict_index = return_list_info(self.final_dataset) self.list_users = list(self.list_users) self.list_items = list(self.list_items)