pycaret / pages /regression.py
tonne's picture
update demo
6c5929d
raw
history blame
No virus
1.32 kB
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",
"cooks": "unknow",
"rfe": "unknow",
"learning": "Learning Curve.png",
"vc": "Validation Curve.png",
"manifold": "Manifold Curve.png",
"feature": "Feature Importance.png",
"feature_all": "Feature Importance (All).png",
"residuals_interactive": "unknow"
}
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)