pgurazada1 commited on
Commit
9c8d27f
·
verified ·
1 Parent(s): f8c337c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -79,6 +79,16 @@ def check_model_drift():
79
  return "No Model Drift!"
80
 
81
 
 
 
 
 
 
 
 
 
 
 
82
  def psi(actual_proportions, expected_proportions):
83
 
84
  psi_values = (actual_proportions - expected_proportions) * \
@@ -139,13 +149,19 @@ def check_data_drift():
139
  with gr.Blocks() as demo:
140
  gr.Markdown("# Real-time Monitoring Dashboard")
141
 
142
- gr.Markdown("Model drift detection (every 5 seconds)")
143
 
144
  with gr.Row():
145
  with gr.Column():
146
  gr.Textbox(check_model_drift, every=5, label="Model Drift Status")
147
 
148
- gr.Markdown("Data drift detection (every 5 seconds)")
 
 
 
 
 
 
149
 
150
  with gr.Row():
151
  with gr.Column():
 
79
  return "No Model Drift!"
80
 
81
 
82
+ def plot_target_distributions():
83
+ sample_df = get_data()
84
+
85
+ figure, axes = plt.subplots(2, 1)
86
+ sns.countplot(x=ytrain, stat='proportion', ax=axes[0])
87
+ sns.countplot(x=sample_df.prediction, stat='proportion', ax=axes[1])
88
+
89
+ return figure
90
+
91
+
92
  def psi(actual_proportions, expected_proportions):
93
 
94
  psi_values = (actual_proportions - expected_proportions) * \
 
149
  with gr.Blocks() as demo:
150
  gr.Markdown("# Real-time Monitoring Dashboard")
151
 
152
+ gr.Markdown("## Model drift detection (every 5 seconds)")
153
 
154
  with gr.Row():
155
  with gr.Column():
156
  gr.Textbox(check_model_drift, every=5, label="Model Drift Status")
157
 
158
+ gr.Markdown("## Distribution of Training Targets")
159
+
160
+ with gr.Row():
161
+ with gr.Column():
162
+ gr.Plot(plot_target_distributions, every=5, label="Target Data Distributions")
163
+
164
+ gr.Markdown("## Data drift detection (every 5 seconds)")
165
 
166
  with gr.Row():
167
  with gr.Column():