Summary
I’m trying to display the feature importance chart from the pycaret library, but the chart is not displayed
Steps to reproduce
Code snippet:
import streamlit as st
from pycaret.regression import *
import pandas as pd
import os
if os.path.exists('./dataset.csv'):
df = pd.read_csv('dataset.csv', index_col=None)
chosen_target = st.selectbox('Choose the Target Column', df.columns)
if st.button('Run Modelling'):
s = setup(df, target=chosen_target, session_id = 123)
best_model = compare_models()
plot_model(best_model, plot='feature', display_format='streamlit')
Apart from the graph, the code works and the model is created correctly. Sample data: Vehicle dataset | Kaggle
Expected behavior:
Need to see feature importance plot like in PyCaret inside Streamlit - #16 by ferdy
Actual behavior:
The plot is not displayed.
Debug info
- Streamlit version: 1.27.2
- Python version: 3.9.13
- Pycaret 3.10