Spaces:
Build error
Build error
fix description formating
Browse files
app.py
CHANGED
|
@@ -40,29 +40,26 @@ def select_features(method,num_features):
|
|
| 40 |
toc_bwd = time()
|
| 41 |
selected_features = feature_names[sfs_backward.get_support()]
|
| 42 |
execution_time = toc_bwd - tic_bwd
|
| 43 |
-
return f"Selected the following features: {'
|
| 44 |
|
| 45 |
title = "Selecting features with Sequential Feature Selection"
|
| 46 |
with gr.Blocks(title=title) as demo:
|
| 47 |
gr.Markdown(f"## {title}")
|
| 48 |
gr.Markdown("""
|
| 49 |
-
This app demonstrates feature selection techniques using model based selection and sequential feature selection.\n
|
| 50 |
-
Model based selection is based on feature importance. Each feature is assigned a score on how much influence they
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
8. Total cholesterol / HDL\n
|
| 64 |
-
9. Possibly log of serum triglycerides level\n
|
| 65 |
-
10. Blood sugar level\n
|
| 66 |
This app is developed based on [scikit-learn example](https://scikit-learn.org/stable/auto_examples/feature_selection/plot_select_from_model_diabetes.html#sphx-glr-auto-examples-feature-selection-plot-select-from-model-diabetes-py)
|
| 67 |
""")
|
| 68 |
|
|
|
|
| 40 |
toc_bwd = time()
|
| 41 |
selected_features = feature_names[sfs_backward.get_support()]
|
| 42 |
execution_time = toc_bwd - tic_bwd
|
| 43 |
+
return f"Selected the following features: {','.join(selected_features)} in {execution_time:.3f} seconds"
|
| 44 |
|
| 45 |
title = "Selecting features with Sequential Feature Selection"
|
| 46 |
with gr.Blocks(title=title) as demo:
|
| 47 |
gr.Markdown(f"## {title}")
|
| 48 |
gr.Markdown("""
|
| 49 |
+
This app demonstrates feature selection techniques using model based selection and sequential feature selection.\n\n
|
| 50 |
+
Model based selection is based on feature importance. Each feature is assigned a score on how much influence they have on the model output. The feature with highest score is considered the most important feature.\n\n
|
| 51 |
+
Sequential feature selection is based on greedy approach. In greedy approach, the feature is added or removed to the selected features at each iteration based on the model performance score.\n\n
|
| 52 |
+
This app uses Ridge estimator and the diabetes dataset from sklearn. Diabetes dataset consist of quantitative measure of diabetes progression and 10 following variables obtained from 442 diabetes patients:
|
| 53 |
+
1. Age (age)
|
| 54 |
+
2. Sex (sex)
|
| 55 |
+
3. Body mass index (bmi)
|
| 56 |
+
4. Average blood pressure (bp)
|
| 57 |
+
5. Total serum cholesterol (s1)
|
| 58 |
+
6. Low-density lipoproteins (s2)
|
| 59 |
+
7. High-density lipoproteins (s3)
|
| 60 |
+
8. Total cholesterol / HDL (s4)
|
| 61 |
+
9. Possibly log of serum triglycerides level (s5)
|
| 62 |
+
10. Blood sugar level (s6)\n\n
|
|
|
|
|
|
|
|
|
|
| 63 |
This app is developed based on [scikit-learn example](https://scikit-learn.org/stable/auto_examples/feature_selection/plot_select_from_model_diabetes.html#sphx-glr-auto-examples-feature-selection-plot-select-from-model-diabetes-py)
|
| 64 |
""")
|
| 65 |
|