File size: 2,057 Bytes
8624212
 
 
 
 
 
 
 
3d367a6
 
8624212
 
 
 
 
 
 
3d367a6
 
8624212
 
3d367a6
8624212
 
 
3d367a6
8624212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
import yfinance as yf
import matplotlib.pyplot as plt
# import numpy as np
import plotly.express as px
from st_aggrid import GridOptionsBuilder, AgGrid
from style import add_logo

hide_menu_style = """
<style>
#MainMenu{visibility: hidden;}
footer{visibility:hidden;}
</style>
"""
# page expands to full width
st.set_page_config(page_title="Predicta.oil | Explore",
                   layout='wide', page_icon="β›½")
st.markdown(hide_menu_style, unsafe_allow_html=True)
st.title("Explore Models")
add_logo()
# ARIMA
# slider interval
interv = st.select_slider('Select Time Series Data Interval for Prediction', options=[
                          'Daily', 'Weekly', 'Monthly', 'Quarterly'], value='Weekly')

# dropdown 50 60 80
st.write("Select Split")
intervals = st.selectbox(
    "Select Interval:", ('80', '60', '50'))

# read file from select interval and dropdown split


def get_location(interv, intervals):
    # location = 'Explore/ARIMA/' + interv + '/' + intervals + '.csv'
    location = 'Explore/PREDICTIONS/' + interv + '/' + intervals + '.csv'
    return location


location = get_location(interv, intervals)

# pagination function for aggrid


def pagination(df):
    gb = GridOptionsBuilder.from_dataframe(df)
    gb.configure_pagination(paginationAutoPageSize=True)
    return gb.build()


# read file
file = pd.read_csv(get_location(interv, intervals))
page = pagination(file)
file.drop("Unnamed: 0", axis=1, inplace=True)

# select columns
columns = file.columns.to_list()
# st.write(columns)
selectedCols = st.multiselect("Select models", columns, default=[
                              "Date", "Close Prices"])
df = file[selectedCols]
st.dataframe(df)

# print(df.columns.values)


fig = go.Figure()
for idx, col in enumerate(df.columns, 0):
    # print(df.iloc[1:,idx])
    if col != 'Date':
        fig.add_trace(go.Scatter(
            x=file['Date'], y=df.iloc[1:, idx], mode='lines', name=col))


st.plotly_chart(fig, use_container_width=True)

# LSTM