Update app.py
Browse files
app.py
CHANGED
@@ -44,12 +44,13 @@ def getColorMap(kernel, gamma):
|
|
44 |
return plt, calculate_score(clf)
|
45 |
|
46 |
#XOR_TABLE markdown text
|
47 |
-
XOR_TABLE = """
|
48 |
-
|
49 |
-
|
50 |
-
| 0 |
|
51 |
-
|
|
52 |
-
| 1 |
|
|
|
53 |
"""
|
54 |
|
55 |
|
@@ -65,7 +66,7 @@ with gr.Blocks() as demo:
|
|
65 |
inp1 = gr.Radio(['poly', 'rbf', 'sigmoid'], label="Kernel", info="Choose a kernel", value="poly")
|
66 |
inp2 = gr.Radio(['scale', 'auto'], label="Gamma", info="Choose a gamma value", value="scale")
|
67 |
|
68 |
-
with gr.Row()
|
69 |
with gr.Column(scale=2):
|
70 |
plot = gr.Plot(label=f"Decision function plot")
|
71 |
with gr.Column(scale=1):
|
@@ -78,7 +79,9 @@ with gr.Blocks() as demo:
|
|
78 |
gr.HTML("<hr>")
|
79 |
|
80 |
# xor_image = Image.open("xor.png")
|
81 |
-
gr.
|
|
|
|
|
82 |
# gr.Image(xor_image, label="Table explaining the 'XOR' operator")
|
83 |
|
84 |
|
|
|
44 |
return plt, calculate_score(clf)
|
45 |
|
46 |
#XOR_TABLE markdown text
|
47 |
+
XOR_TABLE = """
|
48 |
+
| A | B | A XOR B |
|
49 |
+
|:-:|:-:|:-------:|
|
50 |
+
| 0 | 0 | 0 |
|
51 |
+
| 0 | 1 | 1 |
|
52 |
+
| 1 | 0 | 1 |
|
53 |
+
| 1 | 1 | 0 |
|
54 |
"""
|
55 |
|
56 |
|
|
|
66 |
inp1 = gr.Radio(['poly', 'rbf', 'sigmoid'], label="Kernel", info="Choose a kernel", value="poly")
|
67 |
inp2 = gr.Radio(['scale', 'auto'], label="Gamma", info="Choose a gamma value", value="scale")
|
68 |
|
69 |
+
with gr.Row().style(equal_height=True)::
|
70 |
with gr.Column(scale=2):
|
71 |
plot = gr.Plot(label=f"Decision function plot")
|
72 |
with gr.Column(scale=1):
|
|
|
79 |
gr.HTML("<hr>")
|
80 |
|
81 |
# xor_image = Image.open("xor.png")
|
82 |
+
with gr.Column().style(text-align=center):
|
83 |
+
gr.Markdown("## Table explaining the 'XOR' operator")
|
84 |
+
gr.Markdown(XOR_TABLE)
|
85 |
# gr.Image(xor_image, label="Table explaining the 'XOR' operator")
|
86 |
|
87 |
|