Spaces:
Build error
Build error
Commit
·
a24c6bc
1
Parent(s):
4a2a26f
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,9 +12,9 @@ def plot_penalties():
|
|
| 12 |
plt.clf()
|
| 13 |
|
| 14 |
|
| 15 |
-
l1_color = 'r'
|
| 16 |
-
l2_color = 'g'
|
| 17 |
-
elastic_net_color = 'b'
|
| 18 |
|
| 19 |
line = np.linspace(-1.5, 1.5, 1001)
|
| 20 |
xx, yy = np.meshgrid(line, line)
|
|
@@ -63,10 +63,7 @@ with gr.Blocks(title=title) as demo:
|
|
| 63 |
|
| 64 |
gr.Markdown(" **[Demo is based on sklearn docs](https://scikit-learn.org/stable/auto_examples/linear_model/plot_sgd_penalties.html#sphx-glr-auto-examples-linear-model-plot-sgd-penalties-py)**")
|
| 65 |
|
| 66 |
-
|
| 67 |
-
# x = gr.Dropdown(["red", "blue", "green"], label="l1_color", type="index"),
|
| 68 |
-
# y = gr.Dropdown(["red", "blue", "green"], label="l2_color", type="index"),
|
| 69 |
-
# z = gr.Dropdown(["red", "blue", "green"], label="elastic_net_color", type="index"), # not working
|
| 70 |
|
| 71 |
btn = gr.Button(value="Visualize SGD penalties")
|
| 72 |
btn.click(plot_penalties, outputs= gr.Plot() ) #
|
|
|
|
| 12 |
plt.clf()
|
| 13 |
|
| 14 |
|
| 15 |
+
l1_color = 'r' # hard coded as color picker not working
|
| 16 |
+
l2_color = 'g' # hard coded as color picker not working
|
| 17 |
+
elastic_net_color = 'b' # hard coded as color picker not working
|
| 18 |
|
| 19 |
line = np.linspace(-1.5, 1.5, 1001)
|
| 20 |
xx, yy = np.meshgrid(line, line)
|
|
|
|
| 63 |
|
| 64 |
gr.Markdown(" **[Demo is based on sklearn docs](https://scikit-learn.org/stable/auto_examples/linear_model/plot_sgd_penalties.html#sphx-glr-auto-examples-linear-model-plot-sgd-penalties-py)**")
|
| 65 |
|
| 66 |
+
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
btn = gr.Button(value="Visualize SGD penalties")
|
| 69 |
btn.click(plot_penalties, outputs= gr.Plot() ) #
|