Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
import plotly.express as px
|
4 |
-
import
|
5 |
from sklearn.ensemble import RandomForestClassifier
|
6 |
from xgboost import XGBClassifier
|
7 |
from sklearn.tree import DecisionTreeClassifier
|
@@ -57,11 +57,10 @@ if uploaded_file is not None:
|
|
57 |
# Process the file and get results
|
58 |
rf_importance, xgb_importance, cart_importance, corr_matrix = calculate_importances(uploaded_file)
|
59 |
|
60 |
-
# Display the correlation matrix as
|
61 |
st.write("Correlation Matrix:")
|
62 |
-
|
63 |
-
|
64 |
-
st.pyplot(plt)
|
65 |
|
66 |
# Plot and display Random Forest Feature Importances with Plotly
|
67 |
st.write("Random Forest Feature Importance:")
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
import plotly.express as px
|
4 |
+
import plotly.graph_objects as go
|
5 |
from sklearn.ensemble import RandomForestClassifier
|
6 |
from xgboost import XGBClassifier
|
7 |
from sklearn.tree import DecisionTreeClassifier
|
|
|
57 |
# Process the file and get results
|
58 |
rf_importance, xgb_importance, cart_importance, corr_matrix = calculate_importances(uploaded_file)
|
59 |
|
60 |
+
# Display the correlation matrix as an interactive heatmap with Plotly
|
61 |
st.write("Correlation Matrix:")
|
62 |
+
fig_corr = px.imshow(corr_matrix, text_auto=True, aspect="auto", title="Correlation Matrix", color_continuous_scale="coolwarm")
|
63 |
+
st.plotly_chart(fig_corr)
|
|
|
64 |
|
65 |
# Plot and display Random Forest Feature Importances with Plotly
|
66 |
st.write("Random Forest Feature Importance:")
|