File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import sys
2+ from pathlib import Path
3+
14import matplotlib .pyplot as plt
25import numpy as np
36
7+ PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
8+ if str (PROJECT_ROOT ) not in sys .path :
9+ sys .path .insert (0 , str (PROJECT_ROOT ))
10+
411from ge .alias import alias_sample , create_alias_table
512
613
Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import sys
23
34import matplotlib .pyplot as plt
45import networkx as nx
56import numpy as np
67from sklearn .linear_model import LogisticRegression
78from sklearn .manifold import TSNE
89
10+ PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
11+ if str (PROJECT_ROOT ) not in sys .path :
12+ sys .path .insert (0 , str (PROJECT_ROOT ))
13+
914from ge import DeepWalk
1015from ge .classify import Classifier , read_node_label
1116
12- PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
1317WIKI_GRAPH_PATH = PROJECT_ROOT / "data" / "wiki" / "Wiki_edgelist.txt"
1418WIKI_LABEL_PATH = PROJECT_ROOT / "data" / "wiki" / "wiki_labels.txt"
1519SMOKE_GRAPH_PATH = PROJECT_ROOT / "tests" / "Wiki_edgelist.txt"
Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import sys
23
34import matplotlib .pyplot as plt
45import networkx as nx
56import numpy as np
67from sklearn .linear_model import LogisticRegression
78from sklearn .manifold import TSNE
89
9- from ge import LINE
10+ PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
11+ if str (PROJECT_ROOT ) not in sys .path :
12+ sys .path .insert (0 , str (PROJECT_ROOT ))
13+
14+ try :
15+ from ge import LINE
16+ except ImportError as exc :
17+ raise ImportError (
18+ "Unable to import LINE. Use a supported Python/TensorFlow environment "
19+ "(for example Python 3.10-3.12 with tensorflow installed)."
20+ ) from exc
1021from ge .classify import Classifier , read_node_label
1122
12- PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
1323WIKI_GRAPH_PATH = PROJECT_ROOT / "data" / "wiki" / "Wiki_edgelist.txt"
1424WIKI_LABEL_PATH = PROJECT_ROOT / "data" / "wiki" / "wiki_labels.txt"
1525SMOKE_GRAPH_PATH = PROJECT_ROOT / "tests" / "Wiki_edgelist.txt"
Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import sys
23
34import matplotlib .pyplot as plt
45import networkx as nx
56import numpy as np
67from sklearn .linear_model import LogisticRegression
78from sklearn .manifold import TSNE
89
10+ PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
11+ if str (PROJECT_ROOT ) not in sys .path :
12+ sys .path .insert (0 , str (PROJECT_ROOT ))
13+
914from ge import Node2Vec
1015from ge .classify import Classifier , read_node_label
1116
12- PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
1317FLIGHT_GRAPH_PATH = PROJECT_ROOT / "data" / "flight" / "brazil-airports.edgelist"
1418FLIGHT_LABEL_PATH = PROJECT_ROOT / "data" / "flight" / "labels-brazil-airports.txt"
1519SMOKE_GRAPH_PATH = PROJECT_ROOT / "tests" / "Wiki_edgelist.txt"
Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import sys
23
34import matplotlib .pyplot as plt
45import networkx as nx
56import numpy as np
67from sklearn .linear_model import LogisticRegression
78from sklearn .manifold import TSNE
89
10+ PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
11+ if str (PROJECT_ROOT ) not in sys .path :
12+ sys .path .insert (0 , str (PROJECT_ROOT ))
13+
914from ge import Node2Vec
1015from ge .classify import Classifier , read_node_label
1116
12- PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
1317WIKI_GRAPH_PATH = PROJECT_ROOT / "data" / "wiki" / "Wiki_edgelist.txt"
1418WIKI_LABEL_PATH = PROJECT_ROOT / "data" / "wiki" / "wiki_labels.txt"
1519SMOKE_GRAPH_PATH = PROJECT_ROOT / "tests" / "Wiki_edgelist.txt"
Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import sys
23
34import matplotlib .pyplot as plt
45import networkx as nx
56import numpy as np
67from sklearn .linear_model import LogisticRegression
78from sklearn .manifold import TSNE
89
9- from ge import SDNE
10+ PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
11+ if str (PROJECT_ROOT ) not in sys .path :
12+ sys .path .insert (0 , str (PROJECT_ROOT ))
13+
14+ try :
15+ from ge import SDNE
16+ except ImportError as exc :
17+ raise ImportError (
18+ "Unable to import SDNE. Use a supported Python/TensorFlow environment "
19+ "(for example Python 3.10-3.12 with tensorflow installed)."
20+ ) from exc
1021from ge .classify import Classifier , read_node_label
1122
12- PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
1323WIKI_GRAPH_PATH = PROJECT_ROOT / "data" / "wiki" / "Wiki_edgelist.txt"
1424WIKI_LABEL_PATH = PROJECT_ROOT / "data" / "wiki" / "wiki_labels.txt"
1525SMOKE_GRAPH_PATH = PROJECT_ROOT / "tests" / "Wiki_edgelist.txt"
Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import sys
23import tempfile
34
45import matplotlib .pyplot as plt
78from sklearn .linear_model import LogisticRegression
89from sklearn .manifold import TSNE
910
11+ PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
12+ if str (PROJECT_ROOT ) not in sys .path :
13+ sys .path .insert (0 , str (PROJECT_ROOT ))
14+
1015from ge import Struc2Vec
1116from ge .classify import Classifier , read_node_label
1217
13- PROJECT_ROOT = Path (__file__ ).resolve ().parents [1 ]
1418FLIGHT_GRAPH_PATH = PROJECT_ROOT / "data" / "flight" / "brazil-airports.edgelist"
1519FLIGHT_LABEL_PATH = PROJECT_ROOT / "data" / "flight" / "labels-brazil-airports.txt"
1620SMOKE_GRAPH_PATH = PROJECT_ROOT / "tests" / "Wiki_edgelist.txt"
You can’t perform that action at this time.
0 commit comments