File size: 934 Bytes
6c5929d |
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 |
import streamlit as st
from pycaret.regression import *
from pathlib import Path
path_root = Path(Path.cwd())
from pycaret.datasets import get_data
data = get_data('insurance')
s = setup(data, target = 'charges')
best = compare_models()
evaluate_model(best)
with st.sidebar:
st.sidebar.markdown("# Regression Feature ❄️")
evaluation_option = st.selectbox("evaluation", ["residuals", "error", "cooks", "rfe", "learning", "vc", "manifold", "feature", "feature_all", "residuals_interactive", "parameter", "tree"])
st.markdown("# Regression❄️")
st.markdown("## Evaluation")
image_options = {"error": "Prediction Error.png",
"residuals": "Residuals.png"}
try:
st.markdown(f"## {evaluation_option}")
plot_model(best, plot = evaluation_option, save = 'images')
st.image(str(path_root.joinpath(f"images/{image_options[evaluation_option]}")))
except e:
st.text(e)
print(evaluation_option)
|