|
9 | 9 | }, |
10 | 10 | { |
11 | 11 | "cell_type": "code", |
12 | | - "execution_count": 1, |
| 12 | + "execution_count": 15, |
13 | 13 | "metadata": {}, |
14 | 14 | "outputs": [ |
15 | 15 | { |
|
18 | 18 | "text": [ |
19 | 19 | "graphwave\n", |
20 | 20 | "degree2\n", |
21 | | - "drne\n" |
22 | | - ] |
23 | | - }, |
24 | | - { |
25 | | - "name": "stderr", |
26 | | - "output_type": "stream", |
27 | | - "text": [ |
28 | | - "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:493: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", |
29 | | - " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", |
30 | | - "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:494: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", |
31 | | - " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", |
32 | | - "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:495: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", |
33 | | - " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", |
34 | | - "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:496: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", |
35 | | - " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", |
36 | | - "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:497: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", |
37 | | - " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", |
38 | | - "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:502: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", |
39 | | - " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n" |
40 | | - ] |
41 | | - }, |
42 | | - { |
43 | | - "name": "stdout", |
44 | | - "output_type": "stream", |
45 | | - "text": [ |
| 21 | + "drne\n", |
46 | 22 | "node2vec\n", |
47 | 23 | "degree\n", |
48 | 24 | "role2vec\n", |
|
54 | 30 | "segk\n", |
55 | 31 | "riwalk\n" |
56 | 32 | ] |
57 | | - }, |
58 | | - { |
59 | | - "name": "stderr", |
60 | | - "output_type": "stream", |
61 | | - "text": [ |
62 | | - "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.\n", |
63 | | - " warnings.warn(msg, category=DeprecationWarning)\n" |
64 | | - ] |
65 | 33 | } |
66 | 34 | ], |
67 | 35 | "source": [ |
|
426 | 394 | }, |
427 | 395 | { |
428 | 396 | "cell_type": "code", |
429 | | - "execution_count": 10, |
| 397 | + "execution_count": 11, |
430 | 398 | "metadata": {}, |
431 | 399 | "outputs": [ |
432 | 400 | { |
|
464 | 432 | " 'auc_macro': 0.9281}}}" |
465 | 433 | ] |
466 | 434 | }, |
467 | | - "execution_count": 10, |
| 435 | + "execution_count": 11, |
468 | 436 | "metadata": {}, |
469 | 437 | "output_type": "execute_result" |
470 | 438 | } |
|
473 | 441 | "perform_classification(dict_struc2vec_emb, dict_labels)" |
474 | 442 | ] |
475 | 443 | }, |
| 444 | + { |
| 445 | + "cell_type": "markdown", |
| 446 | + "metadata": {}, |
| 447 | + "source": [ |
| 448 | + "## Perform Clustering" |
| 449 | + ] |
| 450 | + }, |
| 451 | + { |
| 452 | + "cell_type": "code", |
| 453 | + "execution_count": 13, |
| 454 | + "metadata": {}, |
| 455 | + "outputs": [ |
| 456 | + { |
| 457 | + "name": "stderr", |
| 458 | + "output_type": "stream", |
| 459 | + "text": [ |
| 460 | + "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/metrics/cluster/supervised.py:859: FutureWarning: The behavior of NMI will change in version 0.22. To match the behavior of 'v_measure_score', NMI will use average_method='arithmetic' by default.\n", |
| 461 | + " FutureWarning)\n" |
| 462 | + ] |
| 463 | + }, |
| 464 | + { |
| 465 | + "data": { |
| 466 | + "text/plain": [ |
| 467 | + "{'overall': {'purity': [0.6717557251908397], 'nmi': [0.48503443794906465]}}" |
| 468 | + ] |
| 469 | + }, |
| 470 | + "execution_count": 13, |
| 471 | + "metadata": {}, |
| 472 | + "output_type": "execute_result" |
| 473 | + } |
| 474 | + ], |
| 475 | + "source": [ |
| 476 | + "perform_clustering(dict_struc2vec_emb, dict_labels)" |
| 477 | + ] |
| 478 | + }, |
| 479 | + { |
| 480 | + "cell_type": "markdown", |
| 481 | + "metadata": {}, |
| 482 | + "source": [ |
| 483 | + "## Perform Centrality Correlation" |
| 484 | + ] |
| 485 | + }, |
| 486 | + { |
| 487 | + "cell_type": "code", |
| 488 | + "execution_count": 14, |
| 489 | + "metadata": {}, |
| 490 | + "outputs": [ |
| 491 | + { |
| 492 | + "data": { |
| 493 | + "text/plain": [ |
| 494 | + "0.9387720917030852" |
| 495 | + ] |
| 496 | + }, |
| 497 | + "execution_count": 14, |
| 498 | + "metadata": {}, |
| 499 | + "output_type": "execute_result" |
| 500 | + } |
| 501 | + ], |
| 502 | + "source": [ |
| 503 | + "from semb.evaluations.centrality_correlation import *\n", |
| 504 | + "centrality_correlation(dataset_graph, \n", |
| 505 | + " dict_struc2vec_emb, \n", |
| 506 | + " centrality='clustering_coeff', \n", |
| 507 | + " similarity='euclidean')" |
| 508 | + ] |
| 509 | + }, |
476 | 510 | { |
477 | 511 | "cell_type": "code", |
478 | 512 | "execution_count": null, |
|
0 commit comments