TET Plot
TET Plots
TET(temp_edgelist, filepath='.', time_scale=None, network_name=None, add_frame=True, test_split=False, figsize=(9, 5), axis_title_font_size=20, ticks_font_size=20, show=True)
Generate TET plots Args: temp_edgelist: a dictionary of temporal edges or a dataset object. filepath: Path to save the TEA Plot. figsize: Size of the figure to save. axis_title_font_size: The font size of xis titles. ticks_font_size: Size of the text in the figure. add_frame: Add the frame to the plot. network_name: Name of the dataset to be used in the TEA plot file. time_scale: time_scale for discretizing data if already not done. test_split: Whether show the test split on the plot. max_time_scale: Maximum number of time_scale to discretize data. show: Whether to show the plot.
Source code in tgx/viz/TET.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
generate_edge_idx_map(edges_per_ts, edge_last_ts)
generates index for edges according to two-level sorting policy: 1. the first level is based on their first appearance timestamp 2. the second level is based on their last appearance timestamp
Source code in tgx/viz/TET.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
generate_edge_last_timestamp(edges_per_ts)
generates a dictionary containing the last timestamp of each edge
Source code in tgx/viz/TET.py
93 94 95 96 97 98 99 100 101 102 |
|
generate_edge_presence_matrix(unique_ts_list, idx_edge_map, edge_idx_map, edges_per_ts)
Returns presence matrix with values 0 and 1 which indicate: value = 0 : edge is not present in this timestamp value = 1 : edge is present in this timestamp
shape: (ts, total number of edges)
Source code in tgx/viz/TET.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
process_presence_matrix(e_presence_matrix, test_ratio_p)
there are 4 types of edge presence: 1. only in train 2. in train and in test 3. in test and train (which is the number 2 but in later timestamps) 4. only in test X: timestamp Y: edge index
Source code in tgx/viz/TET.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|