(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| """ | |
| Implementation of pairwise ranking using scikit-learn LinearSVC | |
| Reference: | |
| "Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich, | |
| T. Graepel, K. Obermayer 1999 | |
| "Learning to rank from medical imaging data." Pedregosa, Fabian, et al., | |
| Machine Learning in Medical Imaging 2012. |
| from pqueue import PersistentQueue | |
| q1 = PersistentQueue("/tmp/queue_storage_dir") | |
| q1.put("1") | |
| q1.put("2") | |
| q1.put("3") | |
| q1.close() | |
| q2 = PersistentQueue("/tmp/queue_storage_dir") | |
| while not q2.empty(): |
| """High difference in classifier accuracies with LinearSVC and SVC. | |
| Get data.npz from [1]. | |
| [1] https://docs.google.com/leaf?id=0B1BhwRZOwyxRZTcxZDA1OWMtZjZkMy00YjgxLWI3ZTMtZjJkNGIyODAyOTQy&hl=en_US | |
| """ | |
| print __doc__ | |
| import numpy as np | |
| from functools import partial |