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 flask | |
import pandas as pd | |
import os | |
from sklearn.neighbors import NearestNeighbors | |
import sys | |
from joblib import load | |
# load the model | |
clf = load('my_model.joblib') |
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
{ | |
"inputs": [0,1,0,2] | |
} |
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
from joblib import dump, load | |
model = # define your model | |
# saves your model to a my_model.joblib file | |
dump(model, 'my_model.joblib') |
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
var webhookcare = require('webhookcare')('<API KEY>') | |
var payload = { | |
result: 'ok!' | |
} | |
webhookcare.send('http://user.com/callback') // Provide the url | |
.header('X-Secret-Header', 'a secret header') // Add headers (optional) | |
.json(payload) // provide a json payload (optional) | |
.end() // Send the request |
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
var dispatch = require('dispatch'); | |
dispatch.url('https://user.com/callback') | |
.send({ | |
json: 'payload' | |
}) | |
.then((result) => { | |
// Webhook successfully delivered | |
}, (error) => { | |
// Retrying later |
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
from keras.preprocessing import sequence | |
max_review_length = 1600 | |
X_train = sequence.pad_sequences(X_train, maxlen=max_review_length) | |
X_test = sequence.pad_sequences(X_test, maxlen=max_review_length) |
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
from keras.layers import LSTM, Convolution1D, Flatten, Dropout, Dense | |
from keras.layers.embeddings import Embedding | |
from keras.models import Sequential | |
max_review_length = 1600 | |
embedding_vecor_length = 300 | |
model = Sequential() | |
model.add(Embedding(top_words, embedding_vecor_length, input_length=max_review_length)) | |
model.add(Convolution1D(64, 3, border_mode='same')) | |
model.add(Convolution1D(32, 3, border_mode='same')) |