Create prediction app
Tags: #streamlit #app #ml #ai
Author: Gagan Bhatia

Input

Import library

1
from naas_drivers import streamlit
2
import streamlit as st
3
from naas_drivers.tools.prediction import Prediction
4
from naas_drivers.tools.yahoofinance import Yahoofinance
5
from naas_drivers.tools.plotly import Plotly
Copied!

Model

Create the Python file necessary to deploy Streamlit app.
1
%%writefile streamlit_app.py
2
3
yf = Yahoofinance()
4
pre = Prediction()
5
plotly = Plotly()
6
7
stock = "TSLA"
8
9
dataset = yf.get(stock_companies = stock)
10
pr = pre.get(dataset=dataset)
11
plt = plotly.stock(pr,"linechart_close")
12
13
st.write("# Prediction for {}".format(stock))
14
st.plotly_chart(plt)
Copied!

Output

Deploy the app from Python file and serve the URL where the app is exposed (NgrokTunnel)

1
streamlit.add("streamlit_app.py", port=9999, debug=False)
Copied!
Last modified 2mo ago
Copy link
Edit on GitHub