Skip to content

Commit

Permalink
Merge pull request rapidsai#5 from daxiongshu/update-ml-notebooks
Browse files Browse the repository at this point in the history
Fix notebook bugs and add running results
  • Loading branch information
dantegd authored Oct 17, 2018
2 parents 4cdb34f + 84b4fa8 commit eb78279
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 30 deletions.
19 changes: 9 additions & 10 deletions python/notebooks/dbscan_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"use mortgage data\n",
"data (10000, 128)\n",
"CPU times: user 4.27 s, sys: 524 ms, total: 4.8 s\n",
"Wall time: 4.79 s\n"
"CPU times: user 24 ms, sys: 4 ms, total: 28 ms\n",
"Wall time: 26.9 ms\n"
]
}
],
Expand Down Expand Up @@ -162,8 +161,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 23.1 s, sys: 552 ms, total: 23.6 s\n",
"Wall time: 23.6 s\n"
"CPU times: user 27.2 s, sys: 72 ms, total: 27.3 s\n",
"Wall time: 27 s\n"
]
}
],
Expand All @@ -182,8 +181,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 1.02 s, sys: 192 ms, total: 1.21 s\n",
"Wall time: 291 ms\n"
"CPU times: user 112 ms, sys: 436 ms, total: 548 ms\n",
"Wall time: 547 ms\n"
]
}
],
Expand All @@ -201,8 +200,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 6.51 s, sys: 80 ms, total: 6.59 s\n",
"Wall time: 6.62 s\n"
"CPU times: user 7.66 s, sys: 108 ms, total: 7.77 s\n",
"Wall time: 7.79 s\n"
]
}
],
Expand Down Expand Up @@ -248,7 +247,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.5.5"
}
},
"nbformat": 4,
Expand Down
20 changes: 10 additions & 10 deletions python/notebooks/pca_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
"text": [
"use mortgage data\n",
"data (1048576, 400)\n",
"CPU times: user 19 s, sys: 1.48 s, total: 20.5 s\n",
"Wall time: 20.5 s\n"
"CPU times: user 16.4 s, sys: 2.32 s, total: 18.7 s\n",
"Wall time: 18.7 s\n"
]
}
],
Expand Down Expand Up @@ -165,8 +165,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 2min 54s, sys: 27.9 s, total: 3min 22s\n",
"Wall time: 38.6 s\n"
"CPU times: user 6min 7s, sys: 1min 37s, total: 7min 44s\n",
"Wall time: 21.3 s\n"
]
}
],
Expand All @@ -186,8 +186,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 952 ms, sys: 504 ms, total: 1.46 s\n",
"Wall time: 1.51 s\n"
"CPU times: user 8.03 s, sys: 2.4 s, total: 10.4 s\n",
"Wall time: 3.3 s\n"
]
}
],
Expand All @@ -205,8 +205,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 688 ms, sys: 244 ms, total: 932 ms\n",
"Wall time: 1.19 s\n"
"CPU times: user 3.37 s, sys: 496 ms, total: 3.87 s\n",
"Wall time: 3.89 s\n"
]
}
],
Expand All @@ -226,7 +226,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"compare pca: cuml vs sklearn singular_values_ NOT equal\n",
"compare pca: cuml vs sklearn singular_values_ equal\n",
"compare pca: cuml vs sklearn components_ equal\n",
"compare pca: cuml vs sklearn explained_variance_ equal\n",
"compare pca: cuml vs sklearn explained_variance_ratio_ equal\n"
Expand Down Expand Up @@ -277,7 +277,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.5.5"
}
},
"nbformat": 4,
Expand Down
19 changes: 9 additions & 10 deletions python/notebooks/tsvd_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
"text": [
"use mortgage data\n",
"data (2097152, 40)\n",
"CPU times: user 6.38 s, sys: 608 ms, total: 6.99 s\n",
"Wall time: 7 s\n"
"CPU times: user 6.21 s, sys: 1.05 s, total: 7.26 s\n",
"Wall time: 7.25 s\n"
]
}
],
Expand Down Expand Up @@ -163,8 +163,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 8.81 s, sys: 392 ms, total: 9.2 s\n",
"Wall time: 1.99 s\n"
"CPU times: user 35.6 s, sys: 3.52 s, total: 39.1 s\n",
"Wall time: 1.39 s\n"
]
}
],
Expand All @@ -185,8 +185,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 260 ms, sys: 200 ms, total: 460 ms\n",
"Wall time: 478 ms\n"
"CPU times: user 5 s, sys: 768 ms, total: 5.77 s\n",
"Wall time: 729 ms\n"
]
}
],
Expand All @@ -204,8 +204,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 344 ms, sys: 188 ms, total: 532 ms\n",
"Wall time: 535 ms\n"
"CPU times: user 1.17 s, sys: 412 ms, total: 1.58 s\n",
"Wall time: 1.59 s\n"
]
}
],
Expand All @@ -232,8 +232,7 @@
}
],
"source": [
"for attr in ['singular_values_','components_','explained_variance_',\n",
" 'explained_variance_ratio_']:\n",
"for attr in ['singular_values_','components_']:\n",
" passed = array_equal(getattr(tsvd_sk,attr),getattr(tsvd_cuml,attr),threshold=0.1)\n",
" # larger error margin due to different algorithms: arpack vs full\n",
" message = 'compare tsvd: cuml vs sklearn {:>25} {}'.format(attr,'equal' if passed else 'NOT equal')\n",
Expand Down

0 comments on commit eb78279

Please sign in to comment.