-
liblinear-ruby: Ruby interface to LIBLINEAR using SWIG
-
classifier-reborn: Bayesian and LSI classification
dependencies: GSL
AWS Lambda: Advanced Coding Session (slides)
Live demos:
- Amazon API Gateway Access Control
- Amazon Kinesis Streams processing
- Amazon Cognito Sync trigger
- AWS CloudFormation Custom Resources
This file contains 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 boto3 | |
iam = boto3.resource('iam') | |
def get_policy_body(arn, version_id=None): | |
""" Return IAM Policy JSON body """ | |
if version_id: | |
version = iam.PolicyVersion(arn, version_id) | |
else: | |
policy = iam.Policy(arn) |
This file contains 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
def lambda_handler(event, context): | |
name = event.get('name') or 'World' | |
print("Name: %s" % name) | |
return "Hello %s!" % name |
This file contains 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
#!/bin/bash | |
BUCKET="YOUR_BUCKET_NAME" # bucket name | |
FILENAME="deployment-package.zip" # upload key | |
TMP_FOLDER="/tmp/lambda-env-tmp/" # will be cleaned | |
OUTPUT_FOLDER="/tmp/lambda-env/" # will be cleaned | |
HERE=${BASH_SOURCE%/*} # relative path to this file's folder | |
LAMBDA_FOLDER="$HERE/lambda/" # relative path |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
def from_sklearn(docs,vect,lda,**kwargs): | |
"""Create Prepared Data from sklearn's vectorizer and Latent Dirichlet | |
Application | |
Parameters | |
---------- | |
docs : Pandas Series. | |
Documents to be passed as an input. | |
vect : Scikit-Learn Vectorizer (CountVectorizer,TfIdfVectorizer). |
This file contains 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
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder