Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-bi
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-bi
Commits
730790f2
提交
730790f2
authored
3月 26, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
48e08bf0
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
580 行增加
和
387 行删除
+580
-387
AppButtonModal.tsx
src/components/AppButtonModal.tsx
+11
-25
DataLayout.tsx
src/components/layout/DataLayout.tsx
+1
-1
withModal.tsx
src/components/withModal.tsx
+30
-0
useQuery.ts
src/hooks/useQuery.ts
+7
-2
ButtonModal.tsx
src/modules/data/digging/apriori/components/ButtonModal.tsx
+80
-22
ButtonModal.tsx
src/modules/data/digging/forest/components/ButtonModal.tsx
+51
-47
ButtonModal.tsx
src/modules/data/digging/fpgrowth/components/ButtonModal.tsx
+13
-21
ButtonModal.tsx
...ules/data/digging/hierarchical/components/ButtonModal.tsx
+61
-41
ButtonModal.tsx
...dules/data/digging/holtwinters/components/ButtonModal.tsx
+29
-58
ButtonModal.tsx
src/modules/data/digging/kmeans/components/ButtonModal.tsx
+78
-37
ButtonModal.tsx
src/modules/data/digging/logistic/components/ButtonModal.tsx
+83
-29
ButtonModal.tsx
src/modules/data/digging/svm/components/ButtonModal.tsx
+44
-35
ButtonModal.tsx
src/modules/data/digging/tree/components/ButtonModal.tsx
+51
-49
query.ts
src/modules/data/preprocess/null/query.ts
+1
-2
query.ts
src/modules/data/process/binning/query.ts
+1
-2
query.ts
src/modules/data/process/date/query.ts
+1
-2
query.ts
src/modules/data/process/desensitization/query.ts
+1
-2
query.ts
src/modules/data/process/group/query.ts
+1
-2
query.ts
src/modules/data/process/logic/query.ts
+1
-2
query.ts
src/modules/data/process/mapping/query.ts
+1
-2
query.ts
src/modules/data/process/number/query.ts
+1
-2
query.ts
src/modules/data/process/string/query.ts
+1
-2
button.tsx
src/modules/demo/button.tsx
+26
-0
markdown.tsx
src/modules/demo/markdown.tsx
+0
-0
routes.tsx
src/modules/demo/routes.tsx
+6
-2
没有找到文件。
src/components/AppButtonModal.tsx
浏览文件 @
730790f2
import
{
useState
}
from
'react'
import
{
cloneElement
,
useState
}
from
'react'
import
{
Button
,
Modal
}
from
'antd'
import
{
Button
,
Modal
}
from
'antd'
export
default
function
AppButtonModal
({
export
default
function
AppButtonModal
({
buttonText
=
'Open Modal'
,
open
:
externalOpen
,
children
,
...
props
}:
any
)
{
open
=
false
,
const
[
internalOpen
,
setOpen
]
=
useState
(
false
)
buttonText
=
'Open Modal'
,
onOk
,
onCancel
,
children
,
...
props
}:
any
)
{
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
open
)
const
showModal
=
()
=>
{
const
actionOpen
=
(
externalOpen
??
externalOpen
)
||
internalOpen
setIsModalOpen
(
true
)
}
const
handleOk
=
async
()
=>
{
// 克隆子元素并注入控制函数
if
(
onOk
)
onOk
()
const
childrenWithProps
=
cloneElement
(
children
,
{
setIsModalOpen
(
false
)
setOpen
:
setOpen
,
}
})
const
handleCancel
=
async
()
=>
{
if
(
onCancel
)
onCancel
()
setIsModalOpen
(
false
)
}
return
(
return
(
<>
<>
<
Button
type=
"primary"
onClick=
{
showModal
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
setOpen
(
true
)
}
>
{
buttonText
}
{
buttonText
}
</
Button
>
</
Button
>
<
Modal
open=
{
isModalOpen
}
onOk=
{
handleOk
}
onCancel=
{
handleCancel
}
{
...
props
}
>
<
Modal
open=
{
actionOpen
}
onCancel=
{
()
=>
setOpen
(
false
)
}
destroyOnClose
{
...
props
}
>
{
children
}
{
children
WithProps
}
</
Modal
>
</
Modal
>
</>
</>
)
)
...
...
src/components/layout/DataLayout.tsx
浏览文件 @
730790f2
...
@@ -80,7 +80,7 @@ const menus: MyMenuItem[] = [
...
@@ -80,7 +80,7 @@ const menus: MyMenuItem[] = [
{
name
:
'文本计算'
,
path
:
'/data/process/string'
},
{
name
:
'文本计算'
,
path
:
'/data/process/string'
},
{
name
:
'数值计算'
,
path
:
'/data/process/number'
},
{
name
:
'数值计算'
,
path
:
'/data/process/number'
},
{
name
:
'逻辑计算'
,
path
:
'/data/process/logic'
},
{
name
:
'逻辑计算'
,
path
:
'/data/process/logic'
},
{
name
:
'数据透视'
,
path
:
'/data/process/perspective'
,
disabled
:
true
},
//
{ name: '数据透视', path: '/data/process/perspective', disabled: true },
],
],
},
},
{
{
...
...
src/components/withModal.tsx
0 → 100644
浏览文件 @
730790f2
import
{
useState
}
from
'react'
import
{
Button
,
Modal
}
from
'antd'
const
withModal
=
(
WrappedComponent
)
=>
{
return
function
WithModalComponent
({
buttonText
=
'Open Modal'
,
open
:
externalOpen
,
...
props
}:
any
)
{
const
[
internalOpen
,
setOpen
]
=
useState
(
false
)
const
actionOpen
=
externalOpen
||
internalOpen
const
handleOk
=
async
()
=>
{
setOpen
(
false
)
}
const
handleCancel
=
async
()
=>
{
setOpen
(
false
)
}
return
(
<>
<
Button
type=
"primary"
onClick=
{
()
=>
setOpen
(
true
)
}
>
{
buttonText
}
</
Button
>
<
Modal
open=
{
actionOpen
}
onOk=
{
handleOk
}
onCancel=
{
handleCancel
}
destroyOnClose
{
...
props
}
>
<
WrappedComponent
setOpen=
{
setOpen
}
/>
</
Modal
>
</>
)
}
}
export
default
withModal
src/hooks/useQuery.ts
浏览文件 @
730790f2
...
@@ -120,6 +120,8 @@ export function useProcessProgressQuery(params: { function_name: string }) {
...
@@ -120,6 +120,8 @@ export function useProcessProgressQuery(params: { function_name: string }) {
select
:
(
res
)
=>
res
.
data
,
select
:
(
res
)
=>
res
.
data
,
enabled
,
enabled
,
refetchInterval
:
enabled
?
10000
:
false
,
refetchInterval
:
enabled
?
10000
:
false
,
staleTime
:
0
,
gcTime
:
0
,
})
})
// 开始轮询的方法
// 开始轮询的方法
...
@@ -131,13 +133,16 @@ export function useProcessProgressQuery(params: { function_name: string }) {
...
@@ -131,13 +133,16 @@ export function useProcessProgressQuery(params: { function_name: string }) {
const
stop
=
()
=>
{
const
stop
=
()
=>
{
setEnabled
(
false
)
setEnabled
(
false
)
}
}
console
.
log
(
query
.
data
)
// 组件卸载时清理
// 组件卸载时清理
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
query
.
data
?.
result
===
'SUCCESS'
||
query
.
data
?.
result
===
'FAIL'
||
query
.
data
?.
result
===
null
)
{
stop
()
}
return
()
=>
{
return
()
=>
{
stop
()
stop
()
}
}
},
[])
},
[
query
.
data
])
return
{
...
query
,
start
,
stop
}
return
{
...
query
,
start
,
stop
}
}
}
src/modules/data/digging/apriori/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -128,27 +128,19 @@ json
...
@@ -128,27 +128,19 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择特征列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercep
t)"
>
<
Form
.
Item
label=
"请输入
最小支持度(min_suppor
t)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"fit_intercept"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"fit_intercept"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否拟合截距项(fit_intercept)
"
title=
"
最小支持度
"
content=
{
content=
{
<>
<>
控制模型是否包含截距项(即偏置项,用于调整模型基线)
控制模型是否包含截距项(即偏置项,用于调整模型基线)
...
@@ -164,13 +156,13 @@ json
...
@@ -164,13 +156,13 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
最小置信度(min_confidence
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"copy_x"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"copy_x"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X)
"
title=
"
最小置信度
"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据)
决定是否复制输入数据(避免修改原始数据)
...
@@ -186,13 +178,13 @@ json
...
@@ -186,13 +178,13 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"请输入
最小提升度(min_lift
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"n_jobs"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Form
.
Item
name=
"n_jobs"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
并行计算核心数(n_jobs)
"
title=
"
最小提升度
"
content=
{
content=
{
<>
<>
选择优化算法(不同算法支持不同正则化类型和计算效率)
选择优化算法(不同算法支持不同正则化类型和计算效率)
...
@@ -206,13 +198,79 @@ json
...
@@ -206,13 +198,79 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入强制正系数(positive)"
>
<
Form
.
Item
label=
"请输入规则最小长度(min_length)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"positive"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"规则最小长度"
content=
{
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
<
br
/>
取值范围:
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
<
br
/>
False(系数可正可负,灵活性高)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入规则最大长度(max_length)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"positive"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"规则最大长度"
content=
{
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
<
br
/>
取值范围:
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
<
br
/>
False(系数可正可负,灵活性高)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入评估指标(metric)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"positive"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"positive"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"评估指标"
content=
{
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
<
br
/>
取值范围:
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
<
br
/>
False(系数可正可负,灵活性高)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入最小阈值(min_threshold)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"min_threshold"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
强制正系数(positive)
"
title=
"
最小阈值
"
content=
{
content=
{
<>
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
...
@@ -229,7 +287,7 @@ json
...
@@ -229,7 +287,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'
20
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'
36
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/digging/forest/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -98,11 +98,6 @@ json
...
@@ -98,11 +98,6 @@ json
const
[
step
,
setStep
]
=
useState
<
number
>
(
-
1
)
const
[
step
,
setStep
]
=
useState
<
number
>
(
-
1
)
const
options
=
[
{
label
:
'True'
,
value
:
true
},
{
label
:
'False'
,
value
:
false
},
]
// 处理下一步按钮逻辑
// 处理下一步按钮逻辑
const
handleNext
=
async
()
=>
{
const
handleNext
=
async
()
=>
{
await
form
.
validateFields
()
await
form
.
validateFields
()
...
@@ -128,100 +123,109 @@ json
...
@@ -128,100 +123,109 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择特征列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
"请选择目标列"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercept
)"
>
<
Form
.
Item
label=
"请输入
树的数量(n_estimators
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
fit_intercept
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
n_estimators
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否拟合截距项(fit_intercept
)"
title=
"
树的数量(n_estimators
)"
content=
{
content=
{
<>
<>
控制
模型是否包含截距项(即偏置项,用于调整模型基线
)
控制
森林中决策树的数量(树越多,模型越稳定,但计算成本越高
)
<
br
/>
<
br
/>
取值范围:
取值范围:≥1 的整数
<
br
/>
True(模型更灵活,适合大多数场景)
<
br
/>
<
br
/>
False(模型强制通过原点,可能欠
拟合)
参数越低意味着树少(模型简单,训练快,可能欠拟合),参数越高意味着树多(模型更精确,计算成本高,可能过
拟合)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
树的最大深度(max_depth
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
copy_x
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
max_depth
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X
)"
title=
"
树的最大深度(max_depth
)"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据
)
限制决策树的最大深度(防止过拟合,控制模型复杂度
)
<
br
/>
<
br
/>
取值范围:
取值范围:≥1 的整数 或 None
<
br
/>
True(安全但内存占用高)
<
br
/>
<
br
/>
False(节省内存,但可能覆盖原始数据)
参数越低意味着树浅(模型简单,可能欠拟合),参数越高意味着树深(模型复杂,可能过拟合),None意味着不限制
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"请输入
节点分裂最小样本数(min_samples_split
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
n_jobs"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入
'
}]
}
>
<
Form
.
Item
name=
"
min_samples_split"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择
'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
并行计算核心数(n_jobs
)"
title=
"
节点分裂最小样本数(min_samples_split
)"
content=
{
content=
{
<>
<>
选择优化算法(不同算法支持不同正则化类型和计算效率)
定义节点分裂所需的最小样本数(防止过拟合)
<
br
/>
<
br
/>
取值范围:≥2 的整数 或 (0.0, 1.0] 的浮点数(表示样本比例)
<
br
/>
取值范围:
参数越低意味着分裂限制少(树更复杂,过拟合风险高),参数越高意味着分裂限制多(树更简单,可能欠拟合)
<
br
/>
</>
None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入最大特征数(max_features)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"max_features"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"最大特征数(max_features)"
content=
{
<>
分裂时考虑的最大特征数(控制特征随机性,提升泛化性)
<
br
/>
取值范围:
<
br
/>
整数(固定数量)
<
br
/>
浮点数(比例)
<
br
/>
'sqrt'(平方根)
<
br
/>
'log2'(对数)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
强制正系数(positive
)"
>
<
Form
.
Item
label=
"请输入
有放回抽样(bootstrap
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
positive
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
bootstrap
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
强制正系数(positive
)"
title=
"
有放回抽样(bootstrap
)"
content=
{
content=
{
<>
<>
是否
强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型
)
是否
对样本进行有放回抽样(True=Bagging,False=用全部样本
)
<
br
/>
<
br
/>
取值范围:
取值范围:
<
br
/>
<
br
/>
True(
系数非负,可能牺牲模型拟合能力
)
True(
样本随机性增强,支持OOB评估,提升泛化性
)
<
br
/>
<
br
/>
False(
系数可正可负,灵活性高
)
False(
所有树用相同样本,降低多样性
)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -229,7 +233,7 @@ json
...
@@ -229,7 +233,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
0
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
5
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/digging/fpgrowth/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -128,24 +128,16 @@ json
...
@@ -128,24 +128,16 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择特征列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercep
t)"
>
<
Form
.
Item
label=
"请输入
最小支持度(min_suppor
t)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
fit_intercep
t"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
min_suppor
t"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Input
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"是否拟合截距项(fit_intercept)"
title=
"是否拟合截距项(fit_intercept)"
...
@@ -164,10 +156,10 @@ json
...
@@ -164,10 +156,10 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
最小置信度(min_confidence
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
copy_x
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
min_confidence
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Input
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"是否复制数据(copy_X)"
title=
"是否复制数据(copy_X)"
...
@@ -186,9 +178,9 @@ json
...
@@ -186,9 +178,9 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"请输入
最小提升度(min_lift
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
n_jobs
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Form
.
Item
name=
"
min_lift
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
...
@@ -206,10 +198,10 @@ json
...
@@ -206,10 +198,10 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
强制正系数(positive
)"
>
<
Form
.
Item
label=
"请输入
规则最小长度(min_length
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
positive
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
min_length
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Input
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"强制正系数(positive)"
title=
"强制正系数(positive)"
...
...
src/modules/data/digging/hierarchical/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -128,58 +128,63 @@ json
...
@@ -128,58 +128,63 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择特征列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercept
)"
>
<
Form
.
Item
label=
"请输入
连接方法(linkage
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"fit_intercept"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"fit_intercept"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Select
options=
{
[
{
label
:
'single'
,
value
:
'single'
},
{
label
:
'complete'
,
value
:
'complete'
},
{
label
:
'ward'
,
value
:
'ward'
},
{
label
:
'average'
,
value
:
'average'
},
]
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否拟合截距项(fit_intercept
)"
title=
"
连接方法(linkage
)"
content=
{
content=
{
<>
<>
控制模型是否包含截距项(即偏置项,用于调整模型基线)
定义簇间距离的计算方式(影响树形结构生成)
<
br
/>
<
br
/>
取值范围:'ward', 'complete', 'average', 'single'
<
br
/>
取值范围:
'single'(最小距离):易形成链式簇
<
br
/>
<
br
/>
'complete'(最大距离):生成紧凑簇
<
br
/>
True(模型更灵活,适合大多数场景)
'ward'(方差最小化):需配合欧氏距离
<
br
/>
<
br
/>
'average'(平均距离):平衡灵敏度
False(模型强制通过原点,可能欠拟合)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
距离度量(affinity 或 metric
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"copy_x"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"affinity"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Select
options=
{
[
{
label
:
'euclidean'
,
value
:
'euclidean'
},
{
label
:
'cosine'
,
value
:
'cosine'
},
{
label
:
'manhattan'
,
value
:
'manhattan'
},
]
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X
)"
title=
"
距离度量(affinity 或 metric
)"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据)
定义样本间距离的计算方法(需与linkage方法兼容)
<
br
/>
<
br
/>
取值范围:'euclidean', 'cosine', 'manhattan'
<
br
/>
取值范围:
'cosine'适合高维稀疏数据
<
br
/>
'manhattan'对异常值更鲁棒
<
br
/>
'euclidean'默认适用于连续特征,但需特征标准化
<
br
/>
<
br
/>
True(安全但内存占用高)
<
br
/>
False(节省内存,但可能覆盖原始数据)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -206,22 +211,37 @@ json
...
@@ -206,22 +211,37 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
强制正系数(positiv
e)"
>
<
Form
.
Item
label=
"请输入
计算完整树形(compute_full_tre
e)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
positiv
e"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
compute_full_tre
e"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
强制正系数(positiv
e)"
title=
"
计算完整树形(compute_full_tre
e)"
content=
{
content=
{
<>
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
是否预先计算完整树形结构(当使用distance_threshold时自动启用)
<
br
/>
<
br
/>
取值范围:'auto', True, False
<
br
/>
取值范围:
False时可能节省内存(但无法回溯完整层次结构)
<
br
/>
<
br
/>
True保证完整树形(内存消耗随样本数平方增长)
True(系数非负,可能牺牲模型拟合能力)
</>
<
br
/>
}
>
False(系数可正可负,灵活性高)
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入距离阈值(distance_threshold)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"distance_threshold"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请选择"
/>
</
Form
.
Item
>
<
Popover
title=
"距离阈值(distance_threshold)"
content=
{
<>
定义簇合并停止的截断距离(若设置则n_clusters无效)
<
br
/>
取值范围:≥0(根据距离度量类型调整,如欧氏距离≥0,余弦相似度∈[0,2])
<
br
/>
参数越低意味着允许更大距离的簇合并(簇更少、更粗粒度),参数越高意味着仅允许小距离的簇合并(簇更多、更细粒度)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -229,7 +249,7 @@ json
...
@@ -229,7 +249,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
0
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
5
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/digging/holtwinters/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -128,100 +128,71 @@ json
...
@@ -128,100 +128,71 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择时间列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
"请选择目标列"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入预测步长"
name=
"step"
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"
请输入是否拟合截距项(fit_intercept
)"
>
<
Form
.
Item
label=
"
α(水平平滑
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
fit_intercept
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
a
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否拟合截距项(fit_intercept)
"
title=
"
水平平滑因子
"
content=
{
content=
{
<>
<>
控制模型是否包含截距项(即偏置项,用于调整模型基线)
控制时间序列**水平分量(Level)**的平滑程度,反映近期数据对预测的影响权重。
<
br
/>
<
br
/>
取值范围:0~1
<
br
/>
取值范围:
● α→1:完全依赖最新观测值(敏感但易受噪声干扰)。
<
br
/>
<
br
/>
● α→0:保留更多历史水平(平滑但响应滞后)。
True(模型更灵活,适合大多数场景)
<
br
/>
<
br
/>
False(模型强制通过原点,可能欠拟合)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"
请输入是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"
β(趋势平滑
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
copy_x
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
b
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X)
"
title=
"
趋势平滑因子
"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据)
控制时间序列**趋势分量(Trend)**的平滑程度,决定趋势变化的敏感度。
<
br
/>
<
br
/>
取值范围:0-1
<
br
/>
取值范围:
● β→1:快速捕捉趋势变化(适合波动性强的场景)。
<
br
/>
●
<
br
/>
β→0:忽略短期趋势波动(适合稳定增长/衰退)。
True(安全但内存占用高)
<
br
/>
False(节省内存,但可能覆盖原始数据)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"
请输入并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"
γ(季节平滑
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
n_jobs
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Form
.
Item
name=
"
y
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"并行计算核心数(n_jobs)"
title=
"季节平滑因子"
content=
{
<>
选择优化算法(不同算法支持不同正则化类型和计算效率)
<
br
/>
取值范围:
<
br
/>
None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入强制正系数(positive)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"positive"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
<
Popover
title=
"强制正系数(positive)"
content=
{
content=
{
<>
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
控制时间序列**季节分量(Seasonality)**的平滑程度,调整周期性波动的影响权重。
<
br
/>
取值范围:
<
br
/>
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
取值范围:0-1
<
br
/>
<
br
/>
False(系数可正可负,灵活性高)
● γ→1:强依赖当前季节周期(适合突发季节性事件)。
<
br
/>
● γ→0:忽略季节性(适合无明显周期的数据)。
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -229,7 +200,7 @@ json
...
@@ -229,7 +200,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'
20
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'
14
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/digging/kmeans/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -128,24 +128,16 @@ json
...
@@ -128,24 +128,16 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择特征列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercept
)"
>
<
Form
.
Item
label=
"请输入
簇数量(n_clusters
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"fit_intercept"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"fit_intercept"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"是否拟合截距项(fit_intercept)"
title=
"是否拟合截距项(fit_intercept)"
...
@@ -164,64 +156,113 @@ json
...
@@ -164,64 +156,113 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
初始化方法(init
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
copy_x
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
init
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X)
"
title=
"
初始化方法init
"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据)
定义初始簇中心的生成方式(影响收敛速度和结果质量)
<
br
/>
取值范围:
<
br
/>
<
br
/>
True(安全但内存占用高)
取值范围:'k-means++', 'random', 或自定义数组
<
br
/>
<
br
/>
False(节省内存,但可能覆盖原始数据
)
随机初始化('random')可能导致不稳定结果,'k-means++' 更智能选择初始点(加速收敛,提高稳定性
)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"请输入
初始化次数(n_init
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"n_
jobs
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Form
.
Item
name=
"n_
init
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
并行计算核心数(n_jobs)
"
title=
"
初始化次数n_init
"
content=
{
content=
{
<>
<>
选择优化算法(不同算法支持不同正则化类型和计算效率)
算法以不同初始中心运行的次数(避免局部最优解)
<
br
/>
取值范围:≥1
<
br
/>
参数越低意味着减少计算次数(结果可能不稳定,但速度快),参数越高意味着增加结果稳定性(计算成本更高)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入最大迭代次数(max_iter)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"max_iter"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"最大迭代次数max_iter"
content=
{
<>
单次运行中的最大迭代次数(防止无限循环)
<
br
/>
<
br
/>
取值范围:
取值范围:
≥1
<
br
/>
<
br
/>
None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心
)
参数越低意味着提前终止迭代(可能未收敛,但节省时间),参数越高意味着允许更多迭代(更可能收敛到最优解,但耗时增加
)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
强制正系数(positive
)"
>
<
Form
.
Item
label=
"请输入
收敛阈值(tol
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
positive
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
tol
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
强制正系数(positive)
"
title=
"
收敛阈值tol
"
content=
{
content=
{
<>
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
两次迭代间簇中心变化的阈值,低于此值则停止迭代
<
br
/>
<
br
/>
取值范围:≥0
<
br
/>
取值范围:
参数越低意味着更宽松的收敛条件(提前停止,可能牺牲精度),参数越高意味着更严格的收敛条件(需更多迭代,结果更精确)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入随机种子(random_state)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"random_state"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"随机种子random_state"
content=
{
<>
控制初始中心选择的随机性(确保结果可复现)
<
br
/>
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
取值范围:整数或None
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入算法实现(algorithm)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"algorithm"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"算法实现algorithm"
content=
{
<>
选择K-Means的计算实现方式(针对效率优化)
<
br
/>
取值范围:'auto', 'full', 'elkan'
<
br
/>
<
br
/>
False(系数可正可负,灵活性高)
'elkan'适用于稠密数据但内存占用高,'full'适用于稀疏数据,'auto'自动根据数据稀疏性选择最优实现
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -229,7 +270,7 @@ json
...
@@ -229,7 +270,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'
20
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'
36
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/digging/logistic/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -142,86 +142,140 @@ json
...
@@ -142,86 +142,140 @@ json
</
Form
.
Item
>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercept
)"
>
<
Form
.
Item
label=
"请输入
正则化强度(C
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
fit_intercept"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择
'
}]
}
>
<
Form
.
Item
name=
"
c"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入
'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否拟合截距项(fit_intercept
)"
title=
"
正则化强度(C
)"
content=
{
content=
{
<>
<>
控制模型是否包含截距项(即偏置项,用于调整模型基线)
控制正则化强度(C越小,正则化越强,防止过拟合)
<
br
/>
取值范围:
<
br
/>
<
br
/>
True(模型更灵活,适合大多数场景)
取值范围:
>
0 的浮点数
<
br
/>
<
br
/>
False(模型强制通过原点,可能欠
拟合)
参数越低意味着正则化强(模型简单,可能欠拟合),参数越高意味着正则化弱(模型复杂,可能过
拟合)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
正则化类型(penalty
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"copy_x"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"penalty"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Select
options=
{
[
{
label
:
'l1'
,
value
:
'l1'
},
{
label
:
'l2'
,
value
:
'l2'
},
{
label
:
'elasticnet'
,
value
:
'elasticnet'
},
]
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X
)"
title=
"
正则化类型(penalty
)"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据
)
选择正则化类型(L1/L2/弹性网络
)
<
br
/>
<
br
/>
取值范围:
取值范围:
<
br
/>
<
br
/>
True(安全但内存占用高)
'l1':L1正则化(稀疏化特征,自动特征选择),适合高维稀疏数据
<
br
/>
'l2':L2正则化(平滑权重,默认),适合低维稠密数据
<
br
/>
<
br
/>
False(节省内存,但可能覆盖原始数据
)
'elasticnet':L1+L2(需配合 solver='saga'
)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"请输入
优化算法(solver
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
n_jobs
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Form
.
Item
name=
"
solver
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
并行计算核心数(n_jobs
)"
title=
"
优化算法(solver
)"
content=
{
content=
{
<>
<>
选择优化算法(不同算法支持不同正则化类型和计算效率)
选择优化算法(不同算法支持不同正则化类型和计算效率)
<
br
/>
<
br
/>
取值范围:
取值范围: 'liblinear':小数据集高效(支持L1/L2),适合小数据,但功能受限
<
br
/>
'newton-cg'/'lbfgs':中大数据集(仅L2)
<
br
/>
'sag'/'saga':大数据集(随机梯度下降,'saga'支持L1/L2/弹性网络)。功能全面,适合大数据
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入最大迭代次数(max_iter)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"max_iter"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"最大迭代次数(max_iter)"
content=
{
<>
优化算法的最大迭代次数(影响模型是否收敛)
<
br
/>
取值范围:≥1 的整数
<
br
/>
参数越低意味着迭代不足(模型未收敛,可能欠拟合),参数越高意味着迭代过多(计算成本高,可能过拟合风险)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入收敛阈值(tol)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"tol"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"收敛阈值(tol)"
content=
{
<>
定义优化停止的阈值(两次迭代损失变化小于该值时停止)
<
br
/>
取值范围:
>
0 的浮点数
<
br
/>
<
br
/>
None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心
)
参数月底意味着阈值宽松(提前停止,可能欠拟合),参数越高意味着阈值严格(更精确收敛,计算时间增加
)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
强制正系数(positive
)"
>
<
Form
.
Item
label=
"请输入
多分类策略(multi_class
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"positive"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"multi_class"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Select
options=
{
[
{
label
:
'ovr'
,
value
:
'ovr'
},
{
label
:
'multinomial'
,
value
:
'multinomial'
},
]
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
强制正系数(positive
)"
title=
"
多分类策略(multi_class
)"
content=
{
content=
{
<>
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
定义多分类问题的解决策略
<
br
/>
<
br
/>
取值范围:
取值范围:
<
br
/>
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
'ovr'(一对多):独立训练每个类的二分类模型,计算简单,适合类别数较少
<
br
/>
<
br
/>
False(系数可正可负,灵活性高)
'multinomial'(多项式):联合优化所有类(需配合
solver='newton-cg'/'lbfgs'/'sag'/'saga')。更精确,适合类别数多或类别相关性强
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -229,7 +283,7 @@ json
...
@@ -229,7 +283,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'
20
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'
31
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/digging/svm/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -128,49 +128,41 @@ json
...
@@ -128,49 +128,41 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择特征列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
"请选择目标列"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercept
)"
>
<
Form
.
Item
label=
"请输入
正则化参数(C
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
fit_intercept
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
c
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否拟合截距项(fit_intercept
)"
title=
"
正则化参数(C
)"
content=
{
content=
{
<>
<>
控制模型是否包含截距项(即偏置项,用于调整模型基线
)
平衡分类精度和模型复杂度(值越大对误分类惩罚越重
)
<
br
/>
<
br
/>
取值范围:
取值范围:
>
0 的浮点数
<
br
/>
<
br
/>
True(模型更灵活,适合大多数场景)
参数越低意味着允许更多误分类(泛化性强,可能欠拟合),参数越高意味着追求更高分类精度(模型复杂,可能过拟合)
<
br
/>
False(模型强制通过原点,可能欠拟合)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
核函数类型(kernel
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
copy_x
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
kernel
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X
)"
title=
"
核函数类型(kernel
)"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据)
决定是否复制输入数据(避免修改原始数据)
...
@@ -186,42 +178,59 @@ json
...
@@ -186,42 +178,59 @@ json
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"请输入
核函数系数(gamma
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
n_jobs
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Form
.
Item
name=
"
gamma
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
并行计算核心数(n_jobs
)"
title=
"
核函数系数(gamma
)"
content=
{
content=
{
<>
<>
选择优化算法(不同算法支持不同正则化类型和计算效率
)
控制核函数的敏感度(影响数据点间的相似性计算
)
<
br
/>
<
br
/>
取值范围:
取值范围:
>
0 的浮点数 或 'scale'(基于特征方差自适应计算)、'auto'(固定为 1/n_features)
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入多项式核次数(degree)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"degree"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
<
Popover
title=
"多项式核次数(degree)"
content=
{
<>
多项式核的阶数(仅当 kernel='poly' 时生效)
<
br
/>
取值范围:≥1 的整数
<
br
/>
参数越低意味着低阶多项式(决策边界简单,计算快),参数越高意味着高阶多项式(复杂边界,计算成本高,易过拟合)
<
br
/>
<
br
/>
None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
强制正系数(positive
)"
>
<
Form
.
Item
label=
"请输入
类别权重(class_weight
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
positive
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
class_weight
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
<
Select
options=
{
options
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
强制正系数(positive
)"
title=
"
类别权重(class_weight
)"
content=
{
content=
{
<>
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型)
调整不同类别样本的权重(解决类别不平衡问题) 取值范围:
<
br
/>
<
br
/>
取值范围:
None:所有类别权重相等
<
br
/>
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
'balanced':按类别样本数反比自动加权
<
br
/>
<
br
/>
False(系数可正可负,灵活性高
)
自定义字典(如
{
'{'
}
0
:
1
,
1
:
5
{
'}'
}
)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -229,7 +238,7 @@ json
...
@@ -229,7 +238,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
0
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
5
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/digging/tree/components/ButtonModal.tsx
浏览文件 @
730790f2
...
@@ -98,11 +98,6 @@ json
...
@@ -98,11 +98,6 @@ json
const
[
step
,
setStep
]
=
useState
<
number
>
(
-
1
)
const
[
step
,
setStep
]
=
useState
<
number
>
(
-
1
)
const
options
=
[
{
label
:
'True'
,
value
:
true
},
{
label
:
'False'
,
value
:
false
},
]
// 处理下一步按钮逻辑
// 处理下一步按钮逻辑
const
handleNext
=
async
()
=>
{
const
handleNext
=
async
()
=>
{
await
form
.
validateFields
()
await
form
.
validateFields
()
...
@@ -128,100 +123,107 @@ json
...
@@ -128,100 +123,107 @@ json
title
:
'设置算法'
,
title
:
'设置算法'
,
content
:
(
content
:
(
<>
<>
<
Form
.
Item
<
Form
.
Item
label=
"请选择特征列"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择自变量"
name=
"independent_variables"
rules=
{
[{
required
:
true
,
message
:
'请选择自变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
mode=
"multiple"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
"请选择目标列"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
label=
"请选择因变量"
name=
"dependent_variable"
rules=
{
[{
required
:
true
,
message
:
'请选择因变量'
}]
}
>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
<
Select
options=
{
fieldOptions
}
placeholder=
"请选择"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Flex
gap=
{
20
}
>
<
Flex
gap=
{
20
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入
是否拟合截距项(fit_intercept
)"
>
<
Form
.
Item
label=
"请输入
树的最大深度(max_depth
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
fit_intercept
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
max_depth
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否拟合截距项(fit_intercept
)"
title=
"
树的最大深度(max_depth
)"
content=
{
content=
{
<>
<>
控制模型是否包含截距项(即偏置项,用于调整模型基线
)
限制决策树的最大深度(防止过拟合,控制模型复杂度
)
<
br
/>
<
br
/>
取值范围:
取值范围:
≥1 的整数 或 None
<
br
/>
<
br
/>
True(模型更灵活,适合大多数场景)
参数越低意味着树浅(模型简单,可能欠拟合),参数越高意味着树深(模型复杂,可能过拟合),None意味着不限制
<
br
/>
False(模型强制通过原点,可能欠拟合)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
是否复制数据(copy_X
)"
>
<
Form
.
Item
label=
"请输入
节点分裂最小样本数(min_samples_split
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
copy_x
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
min_samples_split
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
是否复制数据(copy_X
)"
title=
"
节点分裂最小样本数(min_samples_split
)"
content=
{
content=
{
<>
<>
决定是否复制输入数据(避免修改原始数据)
定义节点分裂所需的最小样本数(防止过拟合)
<
br
/>
<
br
/>
取值范围:≥2 的整数 或 (0.0, 1.0] 的浮点数(表示样本比例)
<
br
/>
取值范围:
参数越低意味着分裂限制少(树更复杂,过拟合风险高),参数越高意味着分裂限制多(树更简单,可能欠拟合)
<
br
/>
True(安全但内存占用高)
<
br
/>
False(节省内存,但可能覆盖原始数据)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
并行计算核心数(n_jobs
)"
>
<
Form
.
Item
label=
"请输入
叶节点最小样本数(min_samples_leaf
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
n_jobs
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Form
.
Item
name=
"
min_samples_leaf
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入'
}]
}
>
<
Input
placeholder=
"请输入"
/>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
并行计算核心数(n_jobs
)"
title=
"
叶节点最小样本数(min_samples_leaf
)"
content=
{
content=
{
<>
<>
选择优化算法(不同算法支持不同正则化类型和计算效率)
定义叶节点所需的最小样本数(防止过拟合)
<
br
/>
<
br
/>
取值范围:≥1 的整数 或 (0.0, 0.5] 的浮点数(表示样本比例)
<
br
/>
取值范围:
参数越低意味着叶节点样本少(对噪声敏感,可能过拟合),参数越高意味着叶节点样本多(泛化性强,可能欠拟合)
<
br
/>
None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Popover
>
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入
强制正系数(positive
)"
>
<
Form
.
Item
label=
"请输入
分裂标准(criterion
)"
>
<
Flex
gap=
{
10
}
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
positive
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
criterion
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Select
options=
{
options
}
placeholder=
"请选择
"
/>
<
Input
placeholder=
"请输入
"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Popover
<
Popover
title=
"
强制正系数(positive
)"
title=
"
分裂标准(criterion
)"
content=
{
content=
{
<>
<>
是否强制回归系数为非负值(适用于需正向解释的场景,如经济学或物理模型
)
选择节点分裂的评估指标(影响决策树对特征的选择方式
)
<
br
/>
<
br
/>
取值范围:
取值范围:
<
br
/>
<
br
/>
True(系数非负,可能牺牲模型拟合能力)
'gini':基尼不纯度,计算快,适合大多数分类任务
<
br
/>
<
br
/>
False(系数可正可负,灵活性高)
'entropy':信息增益,更敏感于类别分布,适合复杂分类问题
</>
}
>
<
QuestionCircleOutlined
/>
</
Popover
>
</
Flex
>
</
Form
.
Item
>
<
Form
.
Item
label=
"请输入最大特征数(max_features)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"max_features"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
title=
"最大特征数(max_features)"
content=
{
<>
分裂时考虑的最大特征数(控制特征随机性,提升泛化性)
<
br
/>
取值范围:
<
br
/>
整数(固定数量)
<
br
/>
浮点数(比例)
<
br
/>
'sqrt'(平方根)
<
br
/>
'log2'(对数)
</>
</>
}
>
}
>
<
QuestionCircleOutlined
/>
<
QuestionCircleOutlined
/>
...
@@ -229,7 +231,7 @@ json
...
@@ -229,7 +231,7 @@ json
</
Flex
>
</
Flex
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
0
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
<
Button
type=
"primary"
style=
{
{
height
:
'2
5
0px'
}
}
onClick=
{
handleAISet
}
loading=
{
isLoading
}
>
AI设置
AI设置
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
src/modules/data/preprocess/null/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'missing'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'missing'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/binning/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'mapping'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'mapping'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/date/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'date'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'date'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/desensitization/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'anonymization'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'anonymization'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/group/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'grouping'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'grouping'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/logic/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'logic'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'logic'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/mapping/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'mapping'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'mapping'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/number/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'numeric'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'numeric'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/data/process/string/query.ts
浏览文件 @
730790f2
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
...
@@ -7,7 +7,7 @@ import { useProcessProgressQuery } from '@/hooks/useQuery'
// 处理数据
// 处理数据
export
function
useProcessData
()
{
export
function
useProcessData
()
{
const
queryClient
=
useQueryClient
()
const
queryClient
=
useQueryClient
()
const
{
data
,
start
,
stop
}
=
useProcessProgressQuery
({
function_name
:
'text'
})
const
{
data
,
start
}
=
useProcessProgressQuery
({
function_name
:
'text'
})
const
query
=
useMutation
({
const
query
=
useMutation
({
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
mutationFn
:
(
data
:
ProcessDataParams
)
=>
{
...
@@ -15,7 +15,6 @@ export function useProcessData() {
...
@@ -15,7 +15,6 @@ export function useProcessData() {
return
processData
(
data
)
return
processData
(
data
)
},
},
onSuccess
:
()
=>
{
onSuccess
:
()
=>
{
stop
()
message
.
success
(
'处理完成'
)
message
.
success
(
'处理完成'
)
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
queryClient
.
invalidateQueries
({
queryKey
:
[
'data'
]
})
},
},
...
...
src/modules/demo/button.tsx
0 → 100644
浏览文件 @
730790f2
import
AppButtonModal
from
'@/components/AppButtonModal'
import
{
useState
}
from
'react'
const
ModalContent
=
({
setOpen
}:
any
)
=>
{
const
[
count
,
setCount
]
=
useState
(
0
)
return
(
<
div
>
<
p
>
You clicked
{
count
}
times
</
p
>
<
button
onClick=
{
()
=>
setCount
(
count
+
1
)
}
>
Click me
</
button
>
<
br
/>
<
br
/>
<
button
onClick=
{
()
=>
setOpen
(
false
)
}
>
关闭
</
button
>
</
div
>
)
}
export
default
function
Button
()
{
return
(
<>
<
AppButtonModal
>
<
ModalContent
></
ModalContent
>
</
AppButtonModal
>
</>
)
}
src/modules/
markdown/Index
.tsx
→
src/modules/
demo/markdown
.tsx
浏览文件 @
730790f2
File moved
src/modules/
markdown
/routes.tsx
→
src/modules/
demo
/routes.tsx
浏览文件 @
730790f2
...
@@ -3,7 +3,11 @@ import type { RouteObject } from 'react-router'
...
@@ -3,7 +3,11 @@ import type { RouteObject } from 'react-router'
export
const
routes
:
RouteObject
[]
=
[
export
const
routes
:
RouteObject
[]
=
[
{
{
path
:
'/markdown'
,
path
:
'/demo/markdown'
,
Component
:
lazy
(()
=>
import
(
'./Index'
)),
Component
:
lazy
(()
=>
import
(
'./markdown'
)),
},
{
path
:
'/demo/button'
,
Component
:
lazy
(()
=>
import
(
'./button'
)),
},
},
]
]
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论