pycaret / pages /.ipynb_checkpoints /regression-checkpoint.py
tonne's picture
update demo
6c5929d
raw
history blame contribute delete
No virus
934 Bytes
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)