beihai's picture
Upload app.py
7865cbb
import streamlit as st
from visualize import plotSurface
from DecisionTree import predictor
def md_contents():
collapse_content = """
<details>
<summary>Getting started</summary>
<a href="https://mp.weixin.qq.com/s/OFoTbEcvbe-k3Ys-wTStPA">streamlit ๆž็ฎ€ๅ…ฅ้—จ</a>
</details>
<details>
<summary>Additional knowledge</summary>
<a href="https://mp.weixin.qq.com/s/74ehblIzwe4rmCM6K-ynEA">ๅ†ณ็ญ–ๆ ‘็š„ๅฏ่ง†ๅŒ–</a>
</details>
"""
st.title("ๅ†ณ็ญ–ๆ ‘่ฅฟ็“œๆŒ‘้€‰ๅ™จ")
st.markdown(collapse_content, unsafe_allow_html=True)
def body():
predictor()
st.markdown("---")
st.write("Source Code")
with st.expander("data.py", expanded=False):
with open("data.py", encoding="UTF-8") as f:
st.code(f.read(), language="python")
with st.expander("DecisionTree.py", expanded=False):
with open("DecisionTree.py", encoding="UTF-8") as f:
st.code(f.read(), language="python")
with st.expander("visualize.py", expanded=False):
with open("visualize.py", encoding="UTF-8") as f:
st.code(f.read(), language="python")
if st.checkbox("decisionTreeViz"):
# viz = decisionTreeViz(model)
# svg = viz.svg()
# svg_write(svg)
ps=plotSurface()
if __name__ == '__main__':
md_contents()
body()