MCPcopy Create free account
hub / github.com/Tencent/embedx / write_node_feature

Method write_node_feature

demo/data/scripts/embedx_graph.py:182–194  ·  view source on GitHub ↗
(self, node_feature_path, group_config_path)

Source from the content-addressed store, hash-verified

180 fout.write("\n")
181
182 def write_node_feature(self, node_feature_path, group_config_path):
183 assert self.has_feature
184 max_feature_num = 0
185 with open(node_feature_path, 'w', encoding='utf-8') as fout:
186 for node in self.next_node():
187 fout.write(EmbedxNode.get_node_feature_str(node))
188 fout.write("\n")
189
190 max_feature_num = max(max_feature_num, len(node.feature))
191
192 with open(group_config_path, 'w', encoding='utf-8') as fout:
193 fout.write(Context.get_group_config_str(max_feature_num))
194 fout.write("\n")
195
196 def write_node_label(self, label_path, train_label_path, test_label_path):
197 with open(label_path, 'w', encoding='utf-8') as label_f, \

Callers 1

runMethod · 0.80

Calls 3

next_nodeMethod · 0.95
get_node_feature_strMethod · 0.80
get_group_config_strMethod · 0.80

Tested by

no test coverage detected