Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ df = df.drop(['id'],axis=1)
|
|
9 |
|
10 |
headers = ["diagnosis","radius_mean","texture_mean","perimeter_mean","area_mean","smoothness_mean","compactness_mean","concavity_mean","concave points_mean","symmetry_mean","fractal_dimension_mean","radius_se","texture_se","perimeter_se","area_se","smoothness_se","compactness_se","concavity_se","concave points_se","symmetry_se","fractal_dimension_se","radius_worst","texture_worst","perimeter_worst","area_worst","smoothness_worst","compactness_worst","concavity_worst","concave points_worst","symmetry_worst","fractal_dimension_worst"]
|
11 |
inputs = [gr.Dataframe(headers = headers, row_count = (2, "dynamic"), col_count=(31,"dynamic"), label="Input Data", interactive=False)]
|
12 |
-
outputs = [gr.Dataframe(row_count = (2, "dynamic"), col_count=(1, "fixed"), label="Predictions", headers=["
|
13 |
|
14 |
def classify_cell(df_input):
|
15 |
# Dropping diagnosis
|
@@ -35,14 +35,15 @@ def classify_cell(df_input):
|
|
35 |
output_string = f"{cancer_classes[cell_pred[i].argmax()]} Cancer Cell : {cell_prob}% confident"
|
36 |
# Appending formatted string for a cell to cell results list
|
37 |
cell_results.append(output_string)
|
38 |
-
return pd.DataFrame(cell_results,columns=["
|
39 |
|
40 |
demo = gr.Interface(classify_cell,
|
41 |
inputs = inputs,
|
42 |
-
examples=[df.iloc[17:22]],
|
43 |
outputs = outputs,
|
44 |
title = "Classify Cancer Cell",
|
45 |
-
description="Classifies Cancer Cell into <b>Malignant</b> or <b>Benign</b> based on its features. Click on the example to classify 5 cells! </br> First Column shows what the cell should be classified as"
|
46 |
-
|
|
|
|
|
47 |
|
48 |
demo.launch(inline=False)
|
|
|
9 |
|
10 |
headers = ["diagnosis","radius_mean","texture_mean","perimeter_mean","area_mean","smoothness_mean","compactness_mean","concavity_mean","concave points_mean","symmetry_mean","fractal_dimension_mean","radius_se","texture_se","perimeter_se","area_se","smoothness_se","compactness_se","concavity_se","concave points_se","symmetry_se","fractal_dimension_se","radius_worst","texture_worst","perimeter_worst","area_worst","smoothness_worst","compactness_worst","concavity_worst","concave points_worst","symmetry_worst","fractal_dimension_worst"]
|
11 |
inputs = [gr.Dataframe(headers = headers, row_count = (2, "dynamic"), col_count=(31,"dynamic"), label="Input Data", interactive=False)]
|
12 |
+
outputs = [gr.Dataframe(row_count = (2, "dynamic"), col_count=(1, "fixed"), label="Predictions", headers=["results"])]
|
13 |
|
14 |
def classify_cell(df_input):
|
15 |
# Dropping diagnosis
|
|
|
35 |
output_string = f"{cancer_classes[cell_pred[i].argmax()]} Cancer Cell : {cell_prob}% confident"
|
36 |
# Appending formatted string for a cell to cell results list
|
37 |
cell_results.append(output_string)
|
38 |
+
return pd.DataFrame(cell_results,columns=["results"])
|
39 |
|
40 |
demo = gr.Interface(classify_cell,
|
41 |
inputs = inputs,
|
|
|
42 |
outputs = outputs,
|
43 |
title = "Classify Cancer Cell",
|
44 |
+
description="Classifies Cancer Cell into <b>Malignant</b> or <b>Benign</b> based on its features. Click on the example to classify 5 cells! </br> First Column shows what the cell should be classified as",
|
45 |
+
examples=[df.iloc[17:22]],
|
46 |
+
cache_examples=False
|
47 |
+
)
|
48 |
|
49 |
demo.launch(inline=False)
|