-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamlitapp.py
101 lines (65 loc) · 3.09 KB
/
streamlitapp.py
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Import libraries and their dependencies
import streamlit as st
import pandas as pd
import numpy as np
import datetime as dt
from pathlib import Path
from PIL import Image
import os
import requests
# Create Header
st.write('''# Renewable Enegergy Portfolio: Is now a good time to buy?''')
st.write('''## Introduction''')
st.write("Using Deep Learning models from SciKit Learn and Tensorflow and using Revenue and EPS as our features, we determine whether our features can be correlated with our renewable stocks future performance. We also provide a dashboard of historical cumulative returns, cumulative profit and P/E multiples to help retail investors compare the performance of our portfolio stocks to the NASDAQ, S&P500 and Fossil Fuel corporations."
"Finally, we display the results of our NLP sentiment analysis to help retail investors make more informed investing decisions than those available on social meddia.")
# First image
image1 = Image.open('./Visualizations/farm.jpg')
st.image(image1)
# Set up sidebar
st.sidebar.header('Choose stock/Index')
stocks = st.sidebar.selectbox('Stocks', ['AQN', 'CSIQ', 'CVX','DQ', 'FSLR', 'SEDG','XOM','SP500','NASDAQ'])
image2 = Image.open('./Visualizations/ui_logo.jpg')
st.sidebar.image(image2)
st.sidebar.write('Group 12: Amany El Gouhary, Katharine Zenta, '
'Nicolas Hernandez, Al Bakomito')
# Project 2 Recap
## Machine Learning Outputs
st.write('''## Project 2 Recap: Machine Learning Outputs''')
st.write('''#### LSTM One-level Sequential Model, 10 Day Window''')
st.write('Portfolio & SPY Closing Price: US$100k Initial Investment')
image3= Image.open('./Visualizations/ML1.jpg')
st.image(image3)
st.write('Validation & Prediction Period')
image4= Image.open('./Visualizations/ML2.jpg')
st.image(image4)
st.write('Validation & Prediction Period: Zoomed in')
image5= Image.open('./Visualizations/ML3.jpg')
st.image(image5)
# Project 3: Prediction & Classification
st.write('''## Project 3: Prediction & Classification''')
st.write('''#### Actual vs. Predicted''')
image6= Image.open('./Visualizations/prediction.jpg')
st.image(image6)
st.write('''#### Classification w/ Fundamentals''')
image7= Image.open('./Visualizations/confusion1.jpg')
st.image(image7)
st.write('''#### Classification w/o Fundamentals''')
image8= Image.open('./Visualizations/confusion2.jpg')
st.image(image8)
# Sentiment Analysis
st.write('''#### Sentiment Analysis: First Solar''')
image9= Image.open('./Visualizations/sentiment.jpg')
st.image(image9)
# Strong Returns & Fundamentals vs. Fossil fuels and Indices
st.write('''#### Think Green Portfolio Cumulative Profit: $29644''')
image10= Image.open('./Visualizations/cumprof.jpg')
st.image(image10)
st.write('''#### S&P500 Cumulative Profit:$15300''')
image11= Image.open('./Visualizations/SP500.jpg')
st.image(image11)
st.write('''#### Think Green vs. Fossil Fuels vs. Indices Cumulative Profit: A clear outperformer''')
image12= Image.open('./Visualizations/allcumprof.jpg')
st.image(image12)
st.write('''#### Elevated PEs will likely unwind''')
image13= Image.open('./Visualizations/pe.jpg')
st.image(image13)