From 9fd425173c3b33d9f309215502efb49cf03b5b82 Mon Sep 17 00:00:00 2001 From: haotian <2421912570@qq.com> Date: Tue, 25 Feb 2025 16:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF--=E8=8E=B7=E5=8F=96=E5=92=8C?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=95=B0=E6=8D=AE=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/__pycache__/data_api.cpython-39.pyc | Bin 3375 -> 3397 bytes api/data_api.py | 1 + doc/接口文档code.md | 2 +- frontend/index.html | 13 + frontend/src/api/data.ts | 40 ++- frontend/src/components/data/DataPreview.vue | 189 ++++++------- .../src/components/data/DataProcessDialog.vue | 197 ++++++++++++++ frontend/src/components/data/DatasetList.vue | 192 ++++++------- frontend/src/router/index.ts | 37 ++- frontend/src/types/data.ts | 16 +- frontend/src/views/data/DataView.vue | 51 ++++ frontend/src/views/data/DatasetView.vue | 47 +++- frontend/src/views/data/FeatureView.vue | 202 ++++++++++++++ frontend/src/views/data/PreprocessView.vue | 253 ++++++++++++++++++ function_old/data_process/__init__.py | 0 .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 151 bytes .../__pycache__/data_cleaner.cpython-39.pyc | Bin 0 -> 2919 bytes .../__pycache__/data_processor.cpython-39.pyc | Bin 0 -> 2492 bytes .../data_processor_date.cpython-39.pyc | Bin 0 -> 8675 bytes .../__pycache__/data_splitter.cpython-39.pyc | Bin 0 -> 1713 bytes .../feature_engineer.cpython-39.pyc | Bin 0 -> 3098 bytes .../__pycache__/method_reader.cpython-39.pyc | Bin 0 -> 2955 bytes .../method_reader_date_feature.cpython-39.pyc | Bin 0 -> 3498 bytes .../method_reader_date_process.cpython-39.pyc | Bin 0 -> 3757 bytes function_old/data_process/data_cleaner.py | 66 +++++ function_old/data_process/data_processor.py | 63 +++++ function_old/data_process/data_splitter.py | 49 ++++ function_old/data_process/feature_engineer.py | 77 ++++++ .../data_process/test_data_processor.py | 34 +++ function_old/data_process/ttt.py | 2 + function_old/test_data_processor.py | 93 +++++++ function_old/test_method_reader.py | 49 ++++ function_old/test_model_manager.py | 99 +++++++ function_old/test_model_trainer.py | 85 ++++++ function_old/test_system_monitor.py | 86 ++++++ function_old/处理乳腺癌数据集.py | 6 + 36 files changed, 1739 insertions(+), 210 deletions(-) create mode 100644 frontend/index.html create mode 100644 frontend/src/components/data/DataProcessDialog.vue create mode 100644 frontend/src/views/data/DataView.vue create mode 100644 frontend/src/views/data/FeatureView.vue create mode 100644 frontend/src/views/data/PreprocessView.vue create mode 100644 function_old/data_process/__init__.py create mode 100644 function_old/data_process/__pycache__/__init__.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/data_cleaner.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/data_processor.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/data_processor_date.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/data_splitter.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/feature_engineer.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/method_reader.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/method_reader_date_feature.cpython-39.pyc create mode 100644 function_old/data_process/__pycache__/method_reader_date_process.cpython-39.pyc create mode 100644 function_old/data_process/data_cleaner.py create mode 100644 function_old/data_process/data_processor.py create mode 100644 function_old/data_process/data_splitter.py create mode 100644 function_old/data_process/feature_engineer.py create mode 100644 function_old/data_process/test_data_processor.py create mode 100644 function_old/data_process/ttt.py create mode 100644 function_old/test_data_processor.py create mode 100644 function_old/test_method_reader.py create mode 100644 function_old/test_model_manager.py create mode 100644 function_old/test_model_trainer.py create mode 100644 function_old/test_system_monitor.py create mode 100644 function_old/处理乳腺癌数据集.py diff --git a/api/__pycache__/data_api.cpython-39.pyc b/api/__pycache__/data_api.cpython-39.pyc index 4776ebd58fb6599071a3b571a6cd5fa75d25fa33..006115bba7a41031390c255c52ceefb58c090e37 100644 GIT binary patch delta 220 zcmZ24bySKsk(ZZ?0SFf6?oHpck@p5?N*s_^C0D|*fN>#1Ekg-Y3S$jJGZQ023R4Y3 z3iBMMaE4$87KRe$$_Pe=T1G~ODy0&Z6qXd$64n~VX2#hJbD2`udYPIS!xlpL6AhZF40Z=5EL6c*$J(q&~Esm7LlEmWFlHw@#;?m^g)Z$`IrXoe4^+l#YVsa&y zo&;NwI*=K~ot|0}4^>@c1d`mv<;X1tWH2x@F>)|+ZD!#XWMquoEXE_o$jr~d2mr*q BF@^vD delta 198 zcmX>qwO)!hk(ZZ?0SHQT_NMo3hbf#Pn1O|% zgsIYxk)f86k)cYdggJ#dg{6e0hOwD(Hp5(|6xLp*CdP1vNQM-)TE;rYJT3@rz+eCr z31-k_pX|w{AQi=4T$-GmT3oEjRHO*B>J~>zVo73gYDw|r4lX@m)*^MFU=(+HYDqj) iV)8jIM@|u-C<8MSBgbYbZb3%Ih|M}YVvNju9E<=`n=RD< diff --git a/api/data_api.py b/api/data_api.py index f70e1b3..6385779 100644 --- a/api/data_api.py +++ b/api/data_api.py @@ -75,6 +75,7 @@ async def get_datasets(): """获取可用数据集列表""" try: datasets = data_manager.get_dataset() + print("datasets", datasets) return { "status": "success", "datasets": datasets diff --git a/doc/接口文档code.md b/doc/接口文档code.md index 8daf658..16d1595 100644 --- a/doc/接口文档code.md +++ b/doc/接口文档code.md @@ -764,7 +764,7 @@ Error Response: ### 3.3 获取系统中训练状态 ---- 未完成, 等开发系统后台时再实现. ```http -GET /api/train/status/{task_id} +GET /model/train/status/{task_id} Response: { diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..1f10fdf --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,13 @@ + + + + + + + 机器学习平台 + + +
+ + + \ No newline at end of file diff --git a/frontend/src/api/data.ts b/frontend/src/api/data.ts index 795aa8a..39de53d 100644 --- a/frontend/src/api/data.ts +++ b/frontend/src/api/data.ts @@ -5,11 +5,15 @@ import type { FeatureMethod, ProcessRequest, CSVRequest, - DatasetInfo + DatasetInfo, + MethodDetail } from '@/types/data' // 获取预处理方法列表 -export const getPreprocessMethods = (): Promise> => { +export const getPreprocessMethods = (): Promise<{ + status: string; + methods: PreprocessMethod[]; +}> => { return request({ url: '/data/preprocessing/methods', method: 'get' @@ -17,7 +21,10 @@ export const getPreprocessMethods = (): Promise => { +export const getPreprocessMethodDetails = (methodName: string): Promise<{ + status: string; + method: MethodDetail; +}> => { return request({ url: `/data/preprocessing/method/${methodName}`, method: 'get' @@ -25,7 +32,10 @@ export const getPreprocessMethodDetails = (methodName: string): Promise> => { +export const getFeatureMethods = (): Promise<{ + status: string; + methods: FeatureMethod[]; +}> => { return request({ url: '/data/feature/methods', method: 'get' @@ -33,7 +43,10 @@ export const getFeatureMethods = (): Promise> => } // 获取特征工程方法详情 -export const getFeatureMethodDetails = (methodName: string): Promise => { +export const getFeatureMethodDetails = (methodName: string): Promise<{ + status: string; + method: MethodDetail; +}> => { return request({ url: `/data/feature/method/${methodName}`, method: 'get' @@ -41,7 +54,10 @@ export const getFeatureMethodDetails = (methodName: string): Promise => { +export const processDataset = (data: ProcessRequest): Promise<{ + status: string; + data: any; +}> => { return request({ url: '/data/process', method: 'post', @@ -49,8 +65,11 @@ export const processDataset = (data: ProcessRequest): Promise => }) } -// 获取可用数据集列表 -export const getDatasets = (): Promise> => { +// 获取数据集列表 +export const getDatasets = (): Promise<{ + status: string; + datasets: DatasetInfo[]; +}> => { return request({ url: '/data/datasets', method: 'get' @@ -58,7 +77,10 @@ export const getDatasets = (): Promise> => { } // 读取CSV文件 -export const readCSV = (data: CSVRequest): Promise => { +export const readCSV = (data: CSVRequest): Promise<{ + status: string; + data: any; +}> => { return request({ url: '/data/csv', method: 'post', diff --git a/frontend/src/components/data/DataPreview.vue b/frontend/src/components/data/DataPreview.vue index 5721ea1..919c650 100644 --- a/frontend/src/components/data/DataPreview.vue +++ b/frontend/src/components/data/DataPreview.vue @@ -4,74 +4,80 @@ title="数据预览" width="80%" > - - - -
- - - {{ dataInfo.train?.info?.rows || '-' }} - - - {{ dataInfo.train?.info?.columns || '-' }} - - - {{ dataInfo.train?.info?.memory_usage || '-' }} - - - -
-

数据预览

- - - -
- -
-

数据统计

- - - - -
-
-
- - - - - - - - - - -
+
+ + + + {{ dataInfo?.info?.rows || '-' }} + + + {{ dataInfo?.info?.columns || '-' }} + + + {{ dataInfo?.info?.memory_usage || '-' }} + + + + +
+

数据预览

+ + + +
+ + +
+

数据统计

+ + + + +
+ + +
+

缺失值统计

+ + + + + + + +
+
\ No newline at end of file diff --git a/frontend/src/components/data/DataProcessDialog.vue b/frontend/src/components/data/DataProcessDialog.vue new file mode 100644 index 0000000..be0b916 --- /dev/null +++ b/frontend/src/components/data/DataProcessDialog.vue @@ -0,0 +1,197 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/data/DatasetList.vue b/frontend/src/components/data/DatasetList.vue index a06c34a..6edea69 100644 --- a/frontend/src/components/data/DatasetList.vue +++ b/frontend/src/components/data/DatasetList.vue @@ -1,22 +1,36 @@