File size: 2,875 Bytes
3501f33 37d4199 3501f33 e6f66da 3501f33 e6f66da 3501f33 e6f66da 1f0abbb e6f66da 1f0abbb e6f66da 1f0abbb e6f66da 1f0abbb e6f66da 3501f33 c431a8c e6f66da |
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
import streamlit as st
from graphviz import Digraph
# Define the emoji to use for the swim lanes
SWIM_LANES = {
"Data Pipelines": "๐",
"Build and Train Models": "๐งช",
"Deploy and Predict": "๐"
}
# Define the graph structure
graph = Digraph()
graph.attr(rankdir="TB") # Top to Bottom or LR Left to Right
graph.attr(fontsize="20")
graph.attr(compound="true")
graph.attr(nodesep="0.5")
# Define the nodes
graph.node("๐ Data Collection")
graph.node("๐งน Data Cleaning")
graph.node("๐ง Data Transformation")
graph.node("๐ Feature Engineering")
graph.node("โ๏ธ Model Selection")
graph.node("๐ Model Training")
graph.node("๐ข Model Deployment")
graph.node("๐ก Model Serving")
graph.node("๐ฎ Predictions")
graph.node("๐ Feedback Collection")
graph.node("๐ค Feedback Processing")
graph.node("โ๏ธ Model Updating")
# Add the edges
graph.edge("๐ Data Collection", "๐งน Data Cleaning")
graph.edge("๐งน Data Cleaning", "๐ง Data Transformation")
graph.edge("๐ง Data Transformation", "๐ Feature Engineering")
graph.edge("๐ Feature Engineering", "โ๏ธ Model Selection")
graph.edge("โ๏ธ Model Selection", "๐ Model Training")
graph.edge("๐ Model Training", "๐ข Model Deployment")
graph.edge("๐ข Model Deployment", "๐ก Model Serving")
graph.edge("๐ก Model Serving", "๐ฎ Predictions")
graph.edge("๐ฎ Predictions", "๐ Feedback Collection")
graph.edge("๐ Feedback Collection", "๐ค Feedback Processing")
graph.edge("๐ค Feedback Processing", "โ๏ธ Model Updating")
graph.edge("โ๏ธ Model Updating", "๐ Model Training")
# Add the swim lanes
with graph.subgraph(name="cluster_0") as c:
c.attr(rank="1")
c.attr(label=SWIM_LANES["Data Pipelines"])
c.edge("๐ Data Collection", "๐งน Data Cleaning", style="invis")
c.edge("๐งน Data Cleaning", "๐ง Data Transformation", style="invis")
with graph.subgraph(name="cluster_1") as c:
c.attr(rank="2")
c.attr(label=SWIM_LANES["Build and Train Models"])
c.edge("๐ Feature Engineering", "โ๏ธ Model Selection", style="invis")
c.edge("โ๏ธ Model Selection", "๐ Model Training", style="invis")
with graph.subgraph(name="cluster_2") as c:
c.attr(rank="3")
c.attr(label=SWIM_LANES["Deploy and Predict"])
c.edge("๐ข Model Deployment", "๐ก Model Serving", style="invis")
c.edge("๐ก Model Serving", "๐ฎ Predictions", style="invis")
with graph.subgraph(name="cluster_3") as c:
c.attr(rank="4")
c.attr(label="Reinforcement Learning Human Feedback")
c.edge("๐ฎ Predictions", "๐ Feedback Collection", style="invis")
c.edge("๐ Feedback Collection", "๐ค Feedback Processing", style="invis")
c.edge("๐ค Feedback Processing", "โ๏ธ Model Updating", style="invis")
# Render the graph in Streamlit
# st.graphviz_chart(graph.source)
st.graphviz_chart(graph.source) |