|
19 | 19 | }, |
20 | 20 | { |
21 | 21 | "cell_type": "code", |
22 | | - "execution_count": null, |
| 22 | + "execution_count": 13, |
23 | 23 | "metadata": {}, |
24 | 24 | "outputs": [], |
25 | 25 | "source": [ |
|
37 | 37 | }, |
38 | 38 | { |
39 | 39 | "cell_type": "code", |
40 | | - "execution_count": null, |
| 40 | + "execution_count": 14, |
41 | 41 | "metadata": {}, |
42 | 42 | "outputs": [], |
43 | 43 | "source": [ |
|
56 | 56 | }, |
57 | 57 | { |
58 | 58 | "cell_type": "code", |
59 | | - "execution_count": null, |
| 59 | + "execution_count": 15, |
60 | 60 | "metadata": {}, |
61 | | - "outputs": [], |
| 61 | + "outputs": [ |
| 62 | + { |
| 63 | + "name": "stdout", |
| 64 | + "output_type": "stream", |
| 65 | + "text": [ |
| 66 | + "Stats: {}\n" |
| 67 | + ] |
| 68 | + } |
| 69 | + ], |
62 | 70 | "source": [ |
63 | 71 | "create_graph_query = '''\n", |
64 | 72 | "MERGE (home:Page {name:'Home'})\n", |
|
100 | 108 | }, |
101 | 109 | { |
102 | 110 | "cell_type": "code", |
103 | | - "execution_count": null, |
| 111 | + "execution_count": 16, |
104 | 112 | "metadata": {}, |
105 | | - "outputs": [], |
| 113 | + "outputs": [ |
| 114 | + { |
| 115 | + "data": { |
| 116 | + "text/html": [ |
| 117 | + "<div>\n", |
| 118 | + "<style scoped>\n", |
| 119 | + " .dataframe tbody tr th:only-of-type {\n", |
| 120 | + " vertical-align: middle;\n", |
| 121 | + " }\n", |
| 122 | + "\n", |
| 123 | + " .dataframe tbody tr th {\n", |
| 124 | + " vertical-align: top;\n", |
| 125 | + " }\n", |
| 126 | + "\n", |
| 127 | + " .dataframe thead th {\n", |
| 128 | + " text-align: right;\n", |
| 129 | + " }\n", |
| 130 | + "</style>\n", |
| 131 | + "<table border=\"1\" class=\"dataframe\">\n", |
| 132 | + " <thead>\n", |
| 133 | + " <tr style=\"text-align: right;\">\n", |
| 134 | + " <th></th>\n", |
| 135 | + " <th>page</th>\n", |
| 136 | + " <th>score</th>\n", |
| 137 | + " </tr>\n", |
| 138 | + " </thead>\n", |
| 139 | + " <tbody>\n", |
| 140 | + " <tr>\n", |
| 141 | + " <th>0</th>\n", |
| 142 | + " <td>Home</td>\n", |
| 143 | + " <td>3.233877</td>\n", |
| 144 | + " </tr>\n", |
| 145 | + " <tr>\n", |
| 146 | + " <th>1</th>\n", |
| 147 | + " <td>About</td>\n", |
| 148 | + " <td>1.060435</td>\n", |
| 149 | + " </tr>\n", |
| 150 | + " <tr>\n", |
| 151 | + " <th>2</th>\n", |
| 152 | + " <td>Product</td>\n", |
| 153 | + " <td>1.060435</td>\n", |
| 154 | + " </tr>\n", |
| 155 | + " <tr>\n", |
| 156 | + " <th>3</th>\n", |
| 157 | + " <td>Links</td>\n", |
| 158 | + " <td>1.060435</td>\n", |
| 159 | + " </tr>\n", |
| 160 | + " <tr>\n", |
| 161 | + " <th>4</th>\n", |
| 162 | + " <td>Site A</td>\n", |
| 163 | + " <td>0.329035</td>\n", |
| 164 | + " </tr>\n", |
| 165 | + " <tr>\n", |
| 166 | + " <th>5</th>\n", |
| 167 | + " <td>Site B</td>\n", |
| 168 | + " <td>0.329035</td>\n", |
| 169 | + " </tr>\n", |
| 170 | + " <tr>\n", |
| 171 | + " <th>6</th>\n", |
| 172 | + " <td>Site C</td>\n", |
| 173 | + " <td>0.329035</td>\n", |
| 174 | + " </tr>\n", |
| 175 | + " <tr>\n", |
| 176 | + " <th>7</th>\n", |
| 177 | + " <td>Site D</td>\n", |
| 178 | + " <td>0.329035</td>\n", |
| 179 | + " </tr>\n", |
| 180 | + " </tbody>\n", |
| 181 | + "</table>\n", |
| 182 | + "</div>" |
| 183 | + ], |
| 184 | + "text/plain": [ |
| 185 | + " page score\n", |
| 186 | + "0 Home 3.233877\n", |
| 187 | + "1 About 1.060435\n", |
| 188 | + "2 Product 1.060435\n", |
| 189 | + "3 Links 1.060435\n", |
| 190 | + "4 Site A 0.329035\n", |
| 191 | + "5 Site B 0.329035\n", |
| 192 | + "6 Site C 0.329035\n", |
| 193 | + "7 Site D 0.329035" |
| 194 | + ] |
| 195 | + }, |
| 196 | + "execution_count": 16, |
| 197 | + "metadata": {}, |
| 198 | + "output_type": "execute_result" |
| 199 | + } |
| 200 | + ], |
106 | 201 | "source": [ |
107 | 202 | "streaming_query = \"\"\"\n", |
108 | 203 | "CALL algo.pageRank.stream('Page', 'LINKS', {iterations:20, dampingFactor:0.85})\n", |
|
128 | 223 | }, |
129 | 224 | { |
130 | 225 | "cell_type": "code", |
131 | | - "execution_count": null, |
| 226 | + "execution_count": 17, |
132 | 227 | "metadata": {}, |
133 | | - "outputs": [], |
| 228 | + "outputs": [ |
| 229 | + { |
| 230 | + "data": { |
| 231 | + "text/html": [ |
| 232 | + "<style>\n", |
| 233 | + ".output_wrapper, .output {\n", |
| 234 | + " height:auto !important;\n", |
| 235 | + " max-height:600px;\n", |
| 236 | + "}\n", |
| 237 | + ".output_scroll {\n", |
| 238 | + " box-shadow:none !important;\n", |
| 239 | + " webkit-box-shadow:none !important;\n", |
| 240 | + "}\n", |
| 241 | + "</style>" |
| 242 | + ], |
| 243 | + "text/plain": [ |
| 244 | + "<IPython.core.display.HTML object>" |
| 245 | + ] |
| 246 | + }, |
| 247 | + "metadata": {}, |
| 248 | + "output_type": "display_data" |
| 249 | + } |
| 250 | + ], |
134 | 251 | "source": [ |
135 | 252 | "%%html\n", |
136 | 253 | "<style>\n", |
|
147 | 264 | }, |
148 | 265 | { |
149 | 266 | "cell_type": "code", |
150 | | - "execution_count": null, |
| 267 | + "execution_count": 18, |
151 | 268 | "metadata": {}, |
152 | | - "outputs": [], |
| 269 | + "outputs": [ |
| 270 | + { |
| 271 | + "data": { |
| 272 | + "text/html": [ |
| 273 | + "\n", |
| 274 | + " <iframe\n", |
| 275 | + " width=\"100%\"\n", |
| 276 | + " height=\"320px\"\n", |
| 277 | + " src=\"figure/graph-9452fd59-1d5f-4eef-8870-8bcfd2b20e02.html\"\n", |
| 278 | + " frameborder=\"0\"\n", |
| 279 | + " allowfullscreen\n", |
| 280 | + " ></iframe>\n", |
| 281 | + " " |
| 282 | + ], |
| 283 | + "text/plain": [ |
| 284 | + "<IPython.lib.display.IFrame at 0x1089a51d0>" |
| 285 | + ] |
| 286 | + }, |
| 287 | + "execution_count": 18, |
| 288 | + "metadata": {}, |
| 289 | + "output_type": "execute_result" |
| 290 | + } |
| 291 | + ], |
153 | 292 | "source": [ |
154 | 293 | "from scripts.vis import generate_vis\n", |
155 | 294 | "\n", |
|
161 | 300 | ] |
162 | 301 | } |
163 | 302 | ], |
164 | | - "metadata": {}, |
| 303 | + "metadata": { |
| 304 | + "kernelspec": { |
| 305 | + "display_name": "Python 3", |
| 306 | + "language": "python", |
| 307 | + "name": "python3" |
| 308 | + }, |
| 309 | + "language_info": { |
| 310 | + "codemirror_mode": { |
| 311 | + "name": "ipython", |
| 312 | + "version": 3 |
| 313 | + }, |
| 314 | + "file_extension": ".py", |
| 315 | + "mimetype": "text/x-python", |
| 316 | + "name": "python", |
| 317 | + "nbconvert_exporter": "python", |
| 318 | + "pygments_lexer": "ipython3", |
| 319 | + "version": "3.6.0" |
| 320 | + } |
| 321 | + }, |
165 | 322 | "nbformat": 4, |
166 | 323 | "nbformat_minor": 2 |
167 | 324 | } |
0 commit comments