|
@@ -12,7 +12,7 @@ from webui import f_project_is_exist, f_data_upload, engine
|
|
|
input_elems = set()
|
|
|
elem_dict = {}
|
|
|
|
|
|
-with gr.Blocks("Easy-ML") as demo:
|
|
|
+with gr.Blocks() as demo:
|
|
|
gr.HTML('<h1 ><center><font size="5">Easy-ML</font></center></h1>')
|
|
|
gr.HTML('<h2 ><center><font size="2">快速建模工具</font></center></h2>')
|
|
|
with gr.Tabs():
|
|
@@ -22,30 +22,35 @@ with gr.Blocks("Easy-ML") as demo:
|
|
|
info="项目名称将会被作为缓存目录名称,如果重复会导致结果被覆盖")
|
|
|
with gr.Row():
|
|
|
file_data = gr.File(label="建模数据")
|
|
|
+ with gr.Row():
|
|
|
+ data_upload = gr.Dataframe(visible=False, label="当前上传数据", max_height=300)
|
|
|
+ with gr.Row():
|
|
|
+ data_insight = gr.Dataframe(visible=False, label="数据探查", max_height=600, wrap=True)
|
|
|
|
|
|
with gr.TabItem("训练"):
|
|
|
with gr.Row():
|
|
|
with gr.Column():
|
|
|
model_type = gr.Dropdown(["lr"], value="lr", label="模型")
|
|
|
search_strategy = gr.Dropdown(["iv"], value="iv", label="特征搜索策略")
|
|
|
- gr.Textbox(label="Y标签")
|
|
|
- gr.Textbox(label="X特征")
|
|
|
+ y_column = gr.Textbox(label="Y标签")
|
|
|
+ x_columns = gr.Textbox(label="X特征")
|
|
|
gr.Slider(0.05, 1, value=0.1, label="分箱组合采样率", step=0.01),
|
|
|
train_button = gr.Button("开始训练", variant="primary")
|
|
|
with gr.Column():
|
|
|
gr.Textbox(value="输出")
|
|
|
|
|
|
- input_elems.update({project_name, file_data, model_type, search_strategy})
|
|
|
+ input_elems.update({project_name, file_data, data_upload, model_type, search_strategy})
|
|
|
elem_dict.update(dict(
|
|
|
project_name=project_name,
|
|
|
file_data=file_data,
|
|
|
+ data_upload=data_upload,
|
|
|
model_type=model_type,
|
|
|
search_strategy=search_strategy
|
|
|
))
|
|
|
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=[])
|
|
|
+ file_data.upload(fn=f_data_upload, inputs=input_elems, outputs=[data_upload, data_insight])
|
|
|
|
|
|
demo.launch(share=True)
|
|
|
|