Skip to the relevant sections if needed.
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
| from google.cloud import speech | |
| from google.cloud.speech import enums | |
| from google.cloud.speech import types | |
| def main(): | |
| credentials_json = "/path/to/json/file" | |
| from google.oauth2 import service_account | |
| cred = service_account.Credentials.from_service_account_file(credentials_json) |
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 datetime | |
| now = datetime.datetime.now() | |
| from datetime import timedelta | |
| diff = datetime.timedelta(days=42) | |
| future = now + diff | |
| future.strftime("%m/%d/%Y") |
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
| #/usr/bin/python | |
| from __future__ import print_function | |
| from __future__ import absolute_import | |
| import inspect | |
| import sys | |
| def foo1(): | |
| pass |
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
| df <- data.frame(Foo=c("A","B","A","B","B","C")) | |
| pt <- as.data.frame(table(df)) | |
| ggplot(pt,aes(x=df,y=Freq)) + geom_bar(stat="identity") | |
| pt$dfOrdered <- reorder(pt$df,pt$Freq) | |
| ggplot(pt,aes(x=dfOrdered,y=Freq)) + geom_bar(stat="identity") | |
| ggplot(pt,aes(y=Freq,x=dfOrdered,fill=dfOrdered)) + geom_bar(stat="identity") + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + theme(legend.position="none") |
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
| virtualenv hb_venv | |
| source ~/hb_venv/bin/activate | |
| pip install hyperopt | |
| pip install scikit-learn |
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
| '''This script goes along the blog post | |
| "Building powerful image classification models using very little data" | |
| from blog.keras.io. | |
| It uses data that can be downloaded at: | |
| https://www.kaggle.com/c/dogs-vs-cats/data | |
| In our setup, we: | |
| - created a data/ folder | |
| - created train/ and validation/ subfolders inside data/ |
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
| -- Max Jaderberg 4/9/13 | |
| -- GPU Effectiveness test | |
| require 'torch' | |
| require 'sys' | |
| require 'nn' | |
| require 'xlua' | |
| cmd = torch.CmdLine() | |
| cmd:text() |
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
| *** Discard git merge: | |
| git reset --hard HEAD | |
| *** Push a new local branch to a remote Git repository and track it too | |
| $ git checkout -b feature_branch_name | |
| ... edit files, add and commit ... | |
| $ git push -u origin feature_branch_name | |
| *** To clean-up dead local branches: | |
| git remote prune origin |
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
| # Be sure that you have installed libraries (if not - google it): | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| import pandas as pd | |
| import xgboost as xgb | |
| from sklearn.preprocessing import LabelEncoder | |
| import numpy as np | |
| from sklearn.metrics import accuracy_score | |
| from sklearn.metrics import mean_squared_error | |
| from sklearn import cross_validation |
NewerOlder