Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,17 +3,19 @@ import gradio as gr
|
|
| 3 |
def readiness_predictor(
|
| 4 |
savings, income, bills, entertainment, sales_skills, dependents, assets, age
|
| 5 |
):
|
| 6 |
-
# Simple heuristic formula
|
| 7 |
disposable_income = income - bills - entertainment
|
| 8 |
score = (
|
| 9 |
-
(savings + assets) / 1000
|
| 10 |
-
+ disposable_income / 500
|
| 11 |
-
+ sales_skills * 2
|
| 12 |
-
- dependents
|
| 13 |
-
+ (40 - abs(35 - age)) / 5
|
| 14 |
)
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
if score < 30:
|
| 18 |
prediction = "Low readiness"
|
| 19 |
elif score < 60:
|
|
@@ -27,7 +29,7 @@ def readiness_predictor(
|
|
| 27 |
}
|
| 28 |
|
| 29 |
with gr.Blocks() as demo:
|
| 30 |
-
gr.Markdown("# Entrepreneurial Readiness Predictor")
|
| 31 |
|
| 32 |
with gr.Row():
|
| 33 |
with gr.Column():
|
|
@@ -50,4 +52,3 @@ with gr.Blocks() as demo:
|
|
| 50 |
)
|
| 51 |
|
| 52 |
demo.launch()
|
| 53 |
-
|
|
|
|
| 3 |
def readiness_predictor(
|
| 4 |
savings, income, bills, entertainment, sales_skills, dependents, assets, age
|
| 5 |
):
|
| 6 |
+
# Simple heuristic formula
|
| 7 |
disposable_income = income - bills - entertainment
|
| 8 |
score = (
|
| 9 |
+
(savings + assets) / 1000 # more savings/assets = better
|
| 10 |
+
+ disposable_income / 500 # more free income = better
|
| 11 |
+
+ sales_skills * 2 # sales skills matter a lot
|
| 12 |
+
- dependents # more dependents = more pressure
|
| 13 |
+
+ (40 - abs(35 - age)) / 5 # ideal range ~35 years old
|
| 14 |
)
|
| 15 |
+
|
| 16 |
+
# Clamp score to 0–100
|
| 17 |
+
score = max(0, min(100, score))
|
| 18 |
+
|
| 19 |
if score < 30:
|
| 20 |
prediction = "Low readiness"
|
| 21 |
elif score < 60:
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
with gr.Blocks() as demo:
|
| 32 |
+
gr.Markdown("# 🚀 Entrepreneurial Readiness Predictor")
|
| 33 |
|
| 34 |
with gr.Row():
|
| 35 |
with gr.Column():
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
demo.launch()
|
|
|