Unverified Commit c69dbbb7 authored by VoVAllen's avatar VoVAllen Committed by GitHub
Browse files

[Bug Fix] Fix TUDataset Processing bug (#489)

* add graph classification dataset

* add node label

* add TUDataset

* Modify to consistent with Qi Huang's implementation

* add docs

* Add docs

* Fix change of environment variable

* Update tu.py

* Update tu.py

* Fix error when add node with np.int64

* Fix processing bug
parent 00fc680a
...@@ -32,7 +32,7 @@ class TUDataset(object): ...@@ -32,7 +32,7 @@ class TUDataset(object):
if use_pandas: if use_pandas:
import pandas as pd import pandas as pd
DS_edge_list = self._idx_from_zero( DS_edge_list = self._idx_from_zero(
pd.read_csv(self._file_path("A"), delimiter=",", dtype=int).values) pd.read_csv(self._file_path("A"), delimiter=",", dtype=int, header=None).values)
else: else:
DS_edge_list = self._idx_from_zero( DS_edge_list = self._idx_from_zero(
np.genfromtxt(self._file_path("A"), delimiter=",", dtype=int)) np.genfromtxt(self._file_path("A"), delimiter=",", dtype=int))
...@@ -45,7 +45,6 @@ class TUDataset(object): ...@@ -45,7 +45,6 @@ class TUDataset(object):
g = dgl.DGLGraph() g = dgl.DGLGraph()
g.add_nodes(int(DS_edge_list.max()) + 1) g.add_nodes(int(DS_edge_list.max()) + 1)
g.add_edges(DS_edge_list[:, 0], DS_edge_list[:, 1]) g.add_edges(DS_edge_list[:, 0], DS_edge_list[:, 1])
g.add_edges(DS_edge_list[:, 1], DS_edge_list[:, 0])
node_idx_list = [] node_idx_list = []
for idx in range(np.max(DS_indicator) + 1): for idx in range(np.max(DS_indicator) + 1):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment