Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -376,8 +376,8 @@ def predict_inverse(antimicrobial_activity_target, substrate, microorganism, num
|
|
376 |
else:
|
377 |
domain.append({'name': str(one_hot_column), 'type': 'categorical', 'domain': (0.0, 0.0)})
|
378 |
elif df_column == 'Washing_cycles':
|
379 |
-
washing_cycles_target_df = pd.DataFrame({'Washing_cycles':[
|
380 |
-
washing_cycles_target_df = scale_numerical(
|
381 |
domain.append({'name': str(df_column), 'type': 'continuous', 'domain': (washing_cycles_target_df, washing_cycles_target_df)})
|
382 |
elif df_column in numerical_columns:
|
383 |
domain.append({'name': str(df_column), 'type': 'continuous', 'domain': (0.,1.)})
|
@@ -462,7 +462,7 @@ with gr.Blocks(css=css_styling, title=page_title, theme=osium_theme) as demo:
|
|
462 |
antimicrobial_activity_target = gr.Text(label="Enter the minimum acceptable antimicrobial activity for your textile coating")
|
463 |
gr.Markdown("### Your constraints")
|
464 |
substrate = gr.Dropdown(label="Your substrate", choices=[c for c in test_data_columns if c.startswith("Substrate")])
|
465 |
-
num_washing_cycles = gr.Text("Your number of washing cycles")
|
466 |
microorganism = gr.Dropdown(label="Microorganism", choices=[c for c in test_data_columns if c.startswith("Microorganism")])
|
467 |
|
468 |
with gr.Column():
|
|
|
376 |
else:
|
377 |
domain.append({'name': str(one_hot_column), 'type': 'categorical', 'domain': (0.0, 0.0)})
|
378 |
elif df_column == 'Washing_cycles':
|
379 |
+
washing_cycles_target_df = pd.DataFrame({'Washing_cycles':[num_washing_cycles]})
|
380 |
+
washing_cycles_target_df = scale_numerical(washing_cycles_target_df, ['Washing_cycles'], scaler=minmax_scaler_targets, fit=False)
|
381 |
domain.append({'name': str(df_column), 'type': 'continuous', 'domain': (washing_cycles_target_df, washing_cycles_target_df)})
|
382 |
elif df_column in numerical_columns:
|
383 |
domain.append({'name': str(df_column), 'type': 'continuous', 'domain': (0.,1.)})
|
|
|
462 |
antimicrobial_activity_target = gr.Text(label="Enter the minimum acceptable antimicrobial activity for your textile coating")
|
463 |
gr.Markdown("### Your constraints")
|
464 |
substrate = gr.Dropdown(label="Your substrate", choices=[c for c in test_data_columns if c.startswith("Substrate")])
|
465 |
+
num_washing_cycles = gr.Text(label="Your number of washing cycles")
|
466 |
microorganism = gr.Dropdown(label="Microorganism", choices=[c for c in test_data_columns if c.startswith("Microorganism")])
|
467 |
|
468 |
with gr.Column():
|