1 | initial version |
Here are the steps to incorporate ExplainerDashboard into a Streamlit application:
pip install explainerdashboard
pip install streamlit
import streamlit as st
from explainerdashboard import ClassifierExplainer, ExplainerDashboard
uploaded_file = st.file_uploader("Upload your input CSV file", type=["csv"])
if uploaded_file is not None:
df = pd.read_csv(uploaded_file)
from sklearn.linear_model import LogisticRegression
X = df.drop(columns=['target'])
y = df['target']
clf = LogisticRegression().fit(X, y)
explainer = ClassifierExplainer(clf, X, y)
db = ExplainerDashboard(explainer)
streamlit.components.v1.html()
function.dashboard_html = db.to_html()
st.components.v1.html(dashboard_html, height=800)
Now you should be able to incorporate ExplainerDashboard into your Streamlit application.