service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval
(in minutes)service.beta.kubernetes.io/aws-load-balancer-access-log-enabled
(true|false)service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
service.beta.kubernetes.io/aws-load-balancer-backend-protocol
(http|https|ssl|tcp)service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled
(true|false)service.beta.kubernetes.io/aws-load-balancer-connection-draining-timeout
(in seconds)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.sparse import csc_matrix | |
def pageRank(G, s = .85, maxerr = .001): | |
""" | |
Computes the pagerank for each of the n states. | |
Used in webpage ranking and text summarization using unweighted | |
or weighted transitions respectively. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as NP | |
from redis import StrictRedis as redis | |
# a 2D array to serialize | |
A = 10 * NP.random.randn(10000).reshape(1000, 10) | |
# flatten the 2D NumPy array and save it as a binary string | |
array_dtype = str(A.dtype) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy.lib | |
import numpy as np | |
import pandas as pd | |
import cPickle as pickle | |
def save_pandas(fname, data): | |
'''Save DataFrame or Series | |
Parameters | |
---------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Notes: | |
- Is about 2ms for (100, (10000, 100)) shape inputs on my i7 laptop | |
- It's 2x faster without doing vector normalize (might make sense to pre-normalize the vectors) | |
""" | |
import numpy as np | |
import numba |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numba | |
@numba.jit(target='cpu', nopython=True) | |
def fast_cosine(u, v): | |
m = u.shape[0] | |
udotv = 0 | |
u_norm = 0 | |
v_norm = 0 | |
for i in range(m): | |
if (np.isnan(u[i])) or (np.isnan(v[i])): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple, hacked-up image similarity search using Tensorflow + the inception | |
CNN as feature extractor and ANNoy for nearest neighbor search. | |
Requires Tensorflow and ANNoy. | |
Based on gist code under | |
https://gist.github.com/david90/e98e1c41a0ebc580e5a9ce25ff6a972d | |
""" | |
from annoy import AnnoyIndex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Dockerfile | |
FROM python:3.6 | |
RUN apt-get install -y ghostscript \ | |
libmagickwand-dev | |
RUN pip install wand PyPDF2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pandas as pd | |
import pyarrow as pa | |
import pyarrow.parquet as pq | |
NUM_FIELDS = 600 | |
NUM_TABLES = 100 | |
fields = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import pyarrow as pa | |
import pyarrow.parquet as pq | |
fields = [ | |
pa.field('column1', pa.string()), | |
pa.field('column2', pa.int64()), | |
pa.field('column3', pa.string()), | |
] |