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

Method write_node_label

demo/data/scripts/embedx_graph.py:196–209  ·  view source on GitHub ↗
(self, label_path, train_label_path, test_label_path)

Source from the content-addressed store, hash-verified

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, \
198 open(train_label_path, 'w', encoding='utf-8') as train_label_f, \
199 open(test_label_path, 'w', encoding='utf-8') as test_label_f:
200 for node in self.next_node():
201 node_str = EmbedxNode.get_node_label_str(node)
202 label_f.write(node_str)
203 label_f.write("\n")
204 if node.stage == "train":
205 train_label_f.write(node_str)
206 train_label_f.write("\n")
207 if node.stage == "test":
208 test_label_f.write(node_str)
209 test_label_f.write("\n")
210
211 def __has_feature(self):
212 flag = None

Callers 1

runMethod · 0.80

Calls 2

next_nodeMethod · 0.95
get_node_label_strMethod · 0.80

Tested by

no test coverage detected