Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,17 @@ theme = gr.themes.Monochrome(
|
|
| 10 |
secondary_hue="blue",
|
| 11 |
neutral_hue="slate",
|
| 12 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
X, y = load_breast_cancer(return_X_y=True)
|
| 15 |
|
|
@@ -77,8 +88,7 @@ with gr.Blocks(theme=theme) as demo:
|
|
| 77 |
<h1 style='text-align: center'>β Post pruning decision trees with cost complexity pruning π </h1>
|
| 78 |
</div>
|
| 79 |
''')
|
| 80 |
-
gr.Markdown(
|
| 81 |
-
" By increasing the value of ccp_alpha, a greater number of nodes can be pruned. This demo demonstrates the impact of ccp_alpha on tree regularization\n Dataset: Breast Cancer")
|
| 82 |
gr.Markdown("Author: <a href=\"https://huggingface.co/vumichien\">Vu Minh Chien</a>. Based on the example from <a href=\"https://scikit-learn.org/stable/auto_examples/tree/plot_cost_complexity_pruning.html#sphx-glr-auto-examples-tree-plot-cost-complexity-pruning-py\">scikit-learn</a>")
|
| 83 |
test_size = gr.Slider(minimum=0, maximum=1, step=0.1, value=0.2, label="Test size")
|
| 84 |
random_state = gr.Slider(minimum=0, maximum=2000, step=1, value=0, label="Random state")
|
|
|
|
| 10 |
secondary_hue="blue",
|
| 11 |
neutral_hue="slate",
|
| 12 |
)
|
| 13 |
+
model_card = f"""
|
| 14 |
+
## Description
|
| 15 |
+
|
| 16 |
+
The **DecisionTreeClassifier** employs a pruning technique that can be configured using the cost complexity parameter, commonly referred to as **ccp_alpha**.
|
| 17 |
+
By increasing the value of ccp_alpha, a greater number of nodes can be pruned. This demo demonstrates the impact of ccp_alpha on tree regularization
|
| 18 |
+
|
| 19 |
+
## Dataset
|
| 20 |
+
|
| 21 |
+
Breast Cancer
|
| 22 |
+
|
| 23 |
+
"""
|
| 24 |
|
| 25 |
X, y = load_breast_cancer(return_X_y=True)
|
| 26 |
|
|
|
|
| 88 |
<h1 style='text-align: center'>β Post pruning decision trees with cost complexity pruning π </h1>
|
| 89 |
</div>
|
| 90 |
''')
|
| 91 |
+
gr.Markdown(model_card)
|
|
|
|
| 92 |
gr.Markdown("Author: <a href=\"https://huggingface.co/vumichien\">Vu Minh Chien</a>. Based on the example from <a href=\"https://scikit-learn.org/stable/auto_examples/tree/plot_cost_complexity_pruning.html#sphx-glr-auto-examples-tree-plot-cost-complexity-pruning-py\">scikit-learn</a>")
|
| 93 |
test_size = gr.Slider(minimum=0, maximum=1, step=0.1, value=0.2, label="Test size")
|
| 94 |
random_state = gr.Slider(minimum=0, maximum=2000, step=1, value=0, label="Random state")
|