Exemplo n.º 1
0
def index():
	# upon user request, lets call the twitter api, and see if the last time
	# is the one in the db (last time not including 24 hour summaries)
	# if its in the db, return that row, otherwise, build out the predictions

	# on the other hand, lets make predictions as a cron job every 60 minutes,
	# and just simply return the latest row to the user
	forest = rforest.forest(train=False)
	frcast = forecast.forecast(forest.X_train.columns, forest.rf)
	return json.jsonify(frcast.df)
Exemplo n.º 2
0
def index():
    forest = rforest.forest(train=False)
    frcast = forecast.forecast(forest.X_train.columns, forest.rf)
    # return flask.json.jsonify({'predictions':frcast.df})
    return json.jsonify(frcast.df)
import rforest
import forecast

forest = rforest.forest(train=False)
frcast = forecast.forecast(forest.X_train.columns, forest.rf)