Spaces:
Runtime error
Runtime error
silvaKenpachi
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,10 @@ pipe = joblib.load("./model.pkl")
|
|
10 |
title = "Premium Amount Prediction"
|
11 |
description = "This model predicts the Premium Amount. Drag and drop any slice from the dataset or edit values as you wish in the dataframe component below."
|
12 |
|
|
|
|
|
|
|
|
|
13 |
# Load configuration
|
14 |
with open("./config.json") as f:
|
15 |
config_dict = json.load(f)
|
@@ -18,11 +22,6 @@ all_headers = config_dict["sklearn"]["columns"]
|
|
18 |
# Filter headers to only include those present in the dataset
|
19 |
headers = [col for col in all_headers if col in df.columns]
|
20 |
|
21 |
-
|
22 |
-
# Load and prepare dataset
|
23 |
-
df = datasets.load_dataset("silvaKenpachi/mental_health")["train"].to_pandas()
|
24 |
-
df.dropna(axis=0, inplace=True)
|
25 |
-
|
26 |
# Define input and output interfaces
|
27 |
inputs = [gr.Dataframe(headers=headers, row_count=(2, "dynamic"), col_count=(len(headers), "fixed"), label="Input Data", interactive=True)]
|
28 |
outputs = [gr.Dataframe(row_count=(2, "dynamic"), col_count=(1, "fixed"), label="Predictions", headers=["Depression"])]
|
|
|
10 |
title = "Premium Amount Prediction"
|
11 |
description = "This model predicts the Premium Amount. Drag and drop any slice from the dataset or edit values as you wish in the dataframe component below."
|
12 |
|
13 |
+
# Load and prepare dataset
|
14 |
+
df = datasets.load_dataset("silvaKenpachi/mental_health")["train"].to_pandas()
|
15 |
+
df.dropna(axis=0, inplace=True)
|
16 |
+
|
17 |
# Load configuration
|
18 |
with open("./config.json") as f:
|
19 |
config_dict = json.load(f)
|
|
|
22 |
# Filter headers to only include those present in the dataset
|
23 |
headers = [col for col in all_headers if col in df.columns]
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
# Define input and output interfaces
|
26 |
inputs = [gr.Dataframe(headers=headers, row_count=(2, "dynamic"), col_count=(len(headers), "fixed"), label="Input Data", interactive=True)]
|
27 |
outputs = [gr.Dataframe(row_count=(2, "dynamic"), col_count=(1, "fixed"), label="Predictions", headers=["Depression"])]
|