Spaces:
Sleeping
Sleeping
File size: 884 Bytes
32ab751 51e4f6b 21fde61 dc0db25 32ab751 027cea7 8328eb2 a28c51d 8328eb2 67b517e 8328eb2 67b517e 8328eb2 67b517e 8328eb2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
from flask import Flask, request, render_template
import pickle
import joblib
import numpy
app = Flask("Modelo Acciones")
@app.route('/', methods=['GET', 'POST'])
def main():
# If a form is submitted
if request.method == "POST":
model = joblib.load("modelo_acciones.pkl")
# Get values through input bars
dias = int(request.form.get("dias"))
try:
dias = int(dias)
except:
dias = 1
output = model.forecast(dias)
prediction = []
i=0
for result in output:
i+=1
prediction.append("Precio de cierre dia " + str(i) +": US$" + str(result))
else:
prediction = ""
return render_template("website.html", outputs = prediction)
# Running the app
if __name__ == '__main__':
app.run(debug = True) |