Loading
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
# We first import all the libraries needed | |
from flask import Flask, request, render_template, jsonify | |
from yhat import Yhat | |
import os | |
#We create the application object of class Flask | |
app = Flask(__name__) | |
# We set our credential to access our model on yhat from the Flask app | |
yh = Yhat(os.environ.get("YHAT_USERNAME"), os.environ.get("YHAT_APIKEY")) |
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
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
Heroku create | |
git push heroku master | |
# Wait for the application to upload on heroku | |
heroku config:set YHAT_USERNAME=your_yhat_username | |
heroku config:set YHAT_APIKEY=your_yhat_api_key |
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
yh = Yhat("YHAT_USERNAME", "YHAT_APIKEY") | |
yh.deploy("NYTimesClassifier", myModel) | |
# Once everything is uploaded you should see the following message | |
uploading... done! | |
{u'modelname': u'NYTimesClassifier', u'status': u'success', u'version': 1} |
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
# Importing the libraries | |
from scipy.stats.stats import pearsonr | |
import pandas as pd | |
import numpy as np | |
import json | |
data = pd.read_csv("../../Downloads/data_books.csv", sep = ",", header=None, | |
names=['Reviewer', 'Book', 'Rating']) | |
# Picking 2 books |
Loading
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
dayone://post?entry=My Daily Review | |
|Daily Review|| | |
|:---|:---| | |
|Summary|[prompt: Today's one word summary]| | |
|Did I work?|[list: Did I work today?|Yes|No]| | |
|Did I relax?|[list: Did I relax today?|Yes|No]| | |
|Physical Exercise|[list: Did I workout today?|Yes|No]| | |
|Satisfaction|[list: Am I happy with what I did today?|Yes|No]| | |
|Goals|[list:Any progress toward my goals?|Yes|No]| |
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 pandas as pd | |
import numpy as np | |
import csv | |
file = "YOUR_FILE_PATH" | |
# Read the csv with python | |
lines=list(csv.reader(open(file))) | |
# Get the name of the columns |
OlderNewer