|
@@ -32,11 +32,12 @@ with gr.Blocks() as demo:
|
|
|
data_insight = gr.Dataframe(visible=False, label="数据探查", max_height=600, wrap=True)
|
|
|
|
|
|
input_elems.update(
|
|
|
- {project_name, file_data, data_upload})
|
|
|
+ {project_name, file_data, data_upload, data_insight})
|
|
|
elem_dict.update(dict(
|
|
|
project_name=project_name,
|
|
|
file_data=file_data,
|
|
|
- data_upload=data_upload
|
|
|
+ data_upload=data_upload,
|
|
|
+ data_insight=data_insight
|
|
|
))
|
|
|
|
|
|
with gr.TabItem("训练"):
|
|
@@ -59,8 +60,24 @@ with gr.Blocks() as demo:
|
|
|
with gr.Row():
|
|
|
test_split_strategy = gr.Dropdown(["随机"], value="随机", label="测试集划分方式")
|
|
|
test_split_rate = gr.Slider(0, 0.5, value=0.3, label="测试集划分比例", step=0.05, interactive=True)
|
|
|
-
|
|
|
train_button = gr.Button("开始训练", variant="primary", elem_id="train_button")
|
|
|
+
|
|
|
+ input_elems.update(
|
|
|
+ {model_type, search_strategy, y_column, x_columns_candidate, x_candidate_num, sample_rate,
|
|
|
+ special_values, test_split_strategy, test_split_rate, train_button
|
|
|
+ })
|
|
|
+ elem_dict.update(dict(
|
|
|
+ model_type=model_type,
|
|
|
+ feature_search_strategy=search_strategy,
|
|
|
+ y_column=y_column,
|
|
|
+ x_columns_candidate=x_columns_candidate,
|
|
|
+ x_candidate_num=x_candidate_num,
|
|
|
+ sample_rate=sample_rate,
|
|
|
+ special_values=special_values,
|
|
|
+ test_split_strategy=test_split_strategy,
|
|
|
+ test_split_rate=test_split_rate,
|
|
|
+ train_button=train_button))
|
|
|
+
|
|
|
with gr.Column():
|
|
|
with gr.Row():
|
|
|
train_progress = gr.Textbox(label="训练进度", scale=4)
|
|
@@ -74,33 +91,26 @@ with gr.Blocks() as demo:
|
|
|
gallery_auc = gr.Gallery(label="auc ks", columns=[1], rows=[2], object_fit="contain",
|
|
|
height="auto", visible=False, interactive=False)
|
|
|
|
|
|
- input_elems.update(
|
|
|
- {model_type, search_strategy, y_column, x_columns_candidate, x_candidate_num, sample_rate,
|
|
|
- special_values, test_split_strategy, test_split_rate
|
|
|
- })
|
|
|
- elem_dict.update(dict(
|
|
|
- model_type=model_type,
|
|
|
- feature_search_strategy=search_strategy,
|
|
|
- y_column=y_column,
|
|
|
- x_columns_candidate=x_columns_candidate,
|
|
|
- x_candidate_num=x_candidate_num,
|
|
|
- sample_rate=sample_rate,
|
|
|
- special_values=special_values,
|
|
|
- test_split_strategy=test_split_strategy,
|
|
|
- test_split_rate=test_split_rate,
|
|
|
- ))
|
|
|
+ input_elems.update(
|
|
|
+ {train_progress, download_report, file_report, auc_df, gallery_auc})
|
|
|
+ elem_dict.update(dict(
|
|
|
+ train_progress=train_progress,
|
|
|
+ download_report=download_report,
|
|
|
+ file_report=file_report,
|
|
|
+ auc_df=auc_df,
|
|
|
+ gallery_auc=gallery_auc))
|
|
|
|
|
|
- engine.add_elems(elem_dict)
|
|
|
+ engine.add_elems(elem_dict)
|
|
|
|
|
|
- project_name.change(fn=f_project_is_exist, inputs=input_elems)
|
|
|
- file_data.upload(fn=f_data_upload, inputs=input_elems, outputs=[data_upload, data_insight, y_column,
|
|
|
- x_columns_candidate])
|
|
|
- train_button.click(fn=f_train, inputs=input_elems,
|
|
|
- outputs=[train_progress, auc_df, gallery_auc, download_report])
|
|
|
- download_report.click(fn=f_download_report, inputs=input_elems, outputs=download_report)
|
|
|
+ project_name.change(fn=f_project_is_exist, inputs=input_elems)
|
|
|
+ file_data.upload(fn=f_data_upload, inputs=input_elems, outputs=[data_upload, data_insight, y_column,
|
|
|
+ x_columns_candidate])
|
|
|
+ train_button.click(fn=f_train, inputs=input_elems,
|
|
|
+ outputs=[train_progress, auc_df, gallery_auc, download_report])
|
|
|
+ download_report.click(fn=f_download_report, inputs=input_elems, outputs=download_report)
|
|
|
|
|
|
- demo.queue(default_concurrency_limit=5)
|
|
|
- demo.launch(share=False, show_error=True)
|
|
|
+ demo.queue(default_concurrency_limit=5)
|
|
|
+ demo.launch(share=False, show_error=True, server_name="0.0.0.0", server_port=18066)
|
|
|
|
|
|
- if __name__ == "__main__":
|
|
|
- pass
|
|
|
+ if __name__ == "__main__":
|
|
|
+ pass
|