Skip to content

Instantly share code, notes, and snippets.

View gagejustins's full-sized avatar

Justin Gage gagejustins

  • New York City
View GitHub Profile
@gagejustins
gagejustins / followers.py
Last active April 5, 2018 13:35
Code for Twitter algorithm spotlight
import Algorithmia
input = {
"username": "elonmusk",
"auth": {
"app_key": "xxxxxxxxxx",
"app_secret": "xxxxxxxxxx",
"oauth_token": "xxxxxxxxxx",
"oauth_token_secret": "xxxxxxxxxx"
}
@gagejustins
gagejustins / call.py
Last active March 23, 2018 14:52
Code for sentiment analysis with Twitter demo
#Define your API Key from Algorithmia
apikey = 'YOUR_API_KEY'
#Initialize the Algorithmia client
client = Algorithmia.client(apikey)
#Create an instance of the RetrieveTweetsWithKeyword algorithm
algo = client.algo('diego/RetrieveTweetsWithKeyword/0.1.2')
#Call the algorithm for both of our keywords and store the results
@gagejustins
gagejustins / call.py
Last active July 9, 2020 20:43
Code for my tutorial on CNNs in Pytorch
CNN = SimpleCNN()
trainNet(CNN, batch_size=32, n_epochs=5, learning_rate=0.001)