-
Notifications
You must be signed in to change notification settings - Fork 2
/
correlation_matrix.py
55 lines (44 loc) · 1.48 KB
/
correlation_matrix.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
# prac.py
# import streamlit as st
# def app():
# st.title('APP1')
# st.write('Welcome to app1')
import matplotlib.pyplot as plt
import pandas as pd
import streamlit as st
import numpy as np
import seaborn as sns
import tkinter
import base64
import plotly.figure_factory as ff
import warnings
warnings.filterwarnings("ignore")
def app():
# Add histogram data
df = pd.read_csv("Dataset/hepatitis.csv")
#x1 = df["class"].tolist()
#x2 = df["age"].tolist()
#x3 = df["sex"].tolist()
# Group data together
#hist_data = [x1, x2, x3]
#group_labels = ['percentage', 'age', 'sex']
# Create distplot with custom bin_size
# fig = ff.create_distplot(hist_data, group_labels, bin_size=[.1, .25, .5])
# Plot!
#st.plotly_chart(fig, use_container_width=True)
# st.set_option('deprecation.showPlotGlobalUse', False)
st.title("Hepatitis Dataset Correlation Matrix")
st.write(sns.heatmap(df.corr()))
st.pyplot()
st.markdown(
f"""
<style>
.reportview-container {{
background: #E55D87; /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #5FC3E4, #E55D87); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #5FC3E4, #E55D87); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}}
</style>
""",
unsafe_allow_html=True
)