Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-bi
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-bi
Commits
5dd0659f
提交
5dd0659f
authored
3月 27, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
840b9e5a
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
155 行增加
和
155 行删除
+155
-155
ButtonModal.tsx
src/modules/data/digging/apriori/components/ButtonModal.tsx
+17
-20
ButtonModal.tsx
src/modules/data/digging/forest/components/ButtonModal.tsx
+17
-15
ButtonModal.tsx
src/modules/data/digging/fpgrowth/components/ButtonModal.tsx
+14
-15
ButtonModal.tsx
...ules/data/digging/hierarchical/components/ButtonModal.tsx
+14
-14
ButtonModal.tsx
...dules/data/digging/holtwinters/components/ButtonModal.tsx
+16
-15
ButtonModal.tsx
src/modules/data/digging/kmeans/components/ButtonModal.tsx
+18
-21
ButtonModal.tsx
src/modules/data/digging/linear/components/ButtonModal.tsx
+9
-7
ButtonModal.tsx
src/modules/data/digging/logistic/components/ButtonModal.tsx
+16
-18
ButtonModal.tsx
src/modules/data/digging/svm/components/ButtonModal.tsx
+17
-15
ButtonModal.tsx
src/modules/data/digging/tree/components/ButtonModal.tsx
+17
-15
没有找到文件。
src/modules/data/digging/apriori/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,11 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个Apriori算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
特征列:
${
values
.
independent_variables
?.
join
(
', '
)}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
min_support"
:
"最小支持度(min_support)"
,
"min_confidence"
:
"最小置信度(min_confidence)"
,
"min_lift"
:
"最小提升度(min_lift)"
,
"min_length"
:
"规则最小长度(min_length)"
,
"max_length"
:
"规则最大长度(max_length)"
,
"metric"
:
"评估指标(metric)"
,
"min_threshold"
:
"最小阈值(min_threshold)"
}
}
`,
},
...
...
@@ -55,8 +55,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +64,14 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的
Apriori
算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
特征列:
$
{
values
.
independent_variables
?.
join
(
', '
)}
最小支持度(
min_support
):
$
{
values
.
min_support
}
最小置信度(
min_confidence
):
$
{
values
.
min_confidence
}
最小提升度(
min_lift
):
$
{
values
.
min_lift
}
规则最小长度(
min_length
):
$
{
values
.
min_length
}
规则最大长度(
max_length
):
$
{
values
.
max_length
}
评估指标(
metric
):
$
{
values
.
metric
}
最小阈值(
min_threshold
):
$
{
values
.
min_threshold
}
返回格式示例:
json
{
...
...
@@ -98,11 +100,6 @@ json
const
[
step
,
setStep
]
=
useState
<
number
>
(
-
1
)
const
options
=
[
{
label
:
'True'
,
value
:
true
},
{
label
:
'False'
,
value
:
false
},
]
// 处理下一步按钮逻辑
const
handleNext
=
async
()
=>
{
await
form
.
validateFields
()
...
...
@@ -315,9 +312,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/forest/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,12 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个随机森林算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
特征列:
${
values
.
independent_variables
?.
join
(
', '
)}
目标列
$
{
values
.
dependent_variable
}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
n_estimators"
:
"树的数量(n_estimators)"
,
"max_depth"
:
"树的最大深度(max_depth)"
,
"min_samples_split"
:
"节点分裂最小样本数(min_samples_split)"
,
"max_features"
:
"最大特征数(max_features)"
“
bootstrap
“:
"有放回抽样(bootstrap)"
}
}
`,
},
...
...
@@ -55,8 +56,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +65,13 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的随机森林算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
特征列:
$
{
values
.
independent_variables
?.
join
(
', '
)}
目标列
$
{
values
.
dependent_variable
}
树的数量(
n_estimators
):
$
{
values
.
n_estimators
}
树的最大深度(
max_depth
):
$
{
values
.
max_depth
}
节点分裂最小样本数(
min_samples_split
):
$
{
values
.
min_samples_split
}
最大特征数(
max_features
):
$
{
values
.
max_features
}
有放回抽样(
bootstrap
):
$
{
values
.
bootstrap
}
返回格式示例:
json
{
...
...
@@ -261,9 +263,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/fpgrowth/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,11 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个FP-Growth算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
特征列
${
values
.
independent_variables
?.
join
(
', '
)}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
min_support"
:
"最小支持度(min_support)"
,
"min_confidence"
:
"最小置信度(min_confidence)"
,
"min_lift"
:
"最小提升度(min_lift)"
,
"min_length"
:
"规则最小长度(min_length)"
}
}
`,
},
...
...
@@ -55,8 +55,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +64,11 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的
FP
-
Growth
算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
特征列
$
{
values
.
independent_variables
?.
join
(
', '
)}
最小支持度(
min_support
:
$
{
values
.
min_support
}
最小置信度(
min_confidence
):
$
{
values
.
min_confidence
}
最小提升度(
min_lift
):
$
{
values
.
min_lift
}
规则最小长度(
min_length
):
$
{
values
.
min_length
}
返回格式示例:
json
{
...
...
@@ -249,9 +248,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/hierarchical/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,11 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个层次聚类算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
特征列:
${
values
.
independent_variables
?.
join
(
', '
)}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
linkage"
:
"连接方法(linkage)"
,
"affinity"
:
"距离度量(affinity 或 metric)"
,
"n_jobs"
:
"并行计算核心数(n_jobs)"
,
"compute_full_tree"
:
"计算完整树形(compute_full_tree)"
,
"distance_threshold"
:
"距离阈值(distance_threshold)"
}
}
`,
},
...
...
@@ -55,8 +55,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +64,12 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的层次聚类算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
特征列:
$
{
values
.
independent_variables
?.
join
(
', '
)}
连接方法(
linkage
):
$
{
values
.
linkage
}
距离度量(
affinity
或
metric
):
$
{
values
.
affinity
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
计算完整树形(
compute_full_tree
):
$
{
values
.
compute_full_tree
}
距离阈值(
distance_threshold
):
$
{
values
.
distance_threshold
}
返回格式示例:
json
{
...
...
@@ -277,9 +277,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/holtwinters/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,12 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个Holt-Winters算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
时间列:
${
values
.
independent_variables
?.
join
(
', '
)}
目标列:
$
{
values
.
dependent_variable
}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
step"
:
"预测步长"
,
"a"
:
"α(水平平滑)"
,
"b"
:
"β(趋势平滑"
,
"y"
:
"γ(季节平滑)"
}
}
`,
},
...
...
@@ -55,8 +56,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +65,12 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的
Holt
-
Winters
算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量
:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
时间列:
$
{
values
.
independent_variables
?
.
join
(
', '
)}
目标列
:
$
{
values
.
dependent_variable
}
预测步长:
$
{
values
.
step
}
α(水平平滑):
$
{
values
.
a
}
β(趋势平滑):
$
{
values
.
b
}
γ(季节平滑):
$
{
values
.
y
}
返回格式示例:
json
{
...
...
@@ -228,9 +229,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/kmeans/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,11 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个K-Means算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
特征列:
${
values
.
independent_variables
?.
join
(
', '
)}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
n_clusters"
:
"簇数量(n_clusters)"
,
"init"
:
"初始化方法(init)"
,
"n_init"
:
"初始化次数(n_init)"
,
"max_iter"
:
"最大迭代次数(max_iter)"
,
"tol"
:
"收敛阈值(tol)"
,
"random_state"
:
"随机种子(random_state)"
,
"algorithm"
:
"算法实现(algorithm)"
}
}
`,
},
...
...
@@ -55,8 +55,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +64,14 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的
K
-
Means
算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
特征列
$
{
values
.
independent_variables
?.
join
(
', '
)}
簇数量(
n_clusters
):
$
{
values
.
n_clusters
}
初始化方法(
init
):
$
{
values
.
init
}
初始化次数(
n_init
):
$
{
values
.
n_init
}
最大迭代次数(
max_iter
):
$
{
values
.
max_iter
}
收敛阈值(
tol
):
$
{
values
.
tol
}
随机种子(
random_state
):
$
{
values
.
random_state
}
算法实现(
algorithm
:
$
{
values
.
algorithm
}
返回格式示例:
json
{
...
...
@@ -98,11 +100,6 @@ json
const
[
step
,
setStep
]
=
useState
<
number
>
(
-
1
)
const
options
=
[
{
label
:
'True'
,
value
:
true
},
{
label
:
'False'
,
value
:
false
},
]
// 处理下一步按钮逻辑
const
handleNext
=
async
()
=>
{
await
form
.
validateFields
()
...
...
@@ -136,7 +133,7 @@ json
<
div
style=
{
{
flex
:
1
}
}
>
<
Form
.
Item
label=
"请输入簇数量(n_clusters)"
>
<
Flex
gap=
{
10
}
>
<
Form
.
Item
name=
"
fit_intercept
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Form
.
Item
name=
"
n_clusters
"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
>
<
Input
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Popover
...
...
@@ -298,9 +295,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/linear/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,8 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,7 +26,7 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个线性回归算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
自变量:
${
values
.
independent_variables
?
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
分别返回是否拟合截距项(
fit_intercept
)
:
true
/
false
、是否复制数据(
copy_x
)
:
true
/
false
、并行计算核心数(
n_jobs
)
:
None
(单线程)或
≥
1
的整数(如
-
1
表示使用所有核心)、强制正系数(
positive
)
:
true
/
false
的值。
返回格式示例:
...
...
@@ -55,8 +56,9 @@ json
const
[
results
,
setResults
]
=
useState
<
any
>
({})
const
code
=
`
${
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values = form.getFieldsValue()
const handleAICompute = async () => {
const values = await form.validateFields()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,7 +66,7 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的线性回归算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
自变量:
$
{
values
.
independent_variables
?
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
...
...
@@ -257,9 +259,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/logistic/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,12 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个逻辑回归算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
自变量:
${
values
.
independent_variables
?
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
c"
:
"正则化强度(C)"
,
"penalty"
:
"正则化类型(penalty)"
,
"solver"
:
"优化算法(solver)"
,
"max_iter"
:
"最大迭代次数(max_iter)"
,
"tol"
:
"收敛阈值(tol)"
,
"multi_class"
:
"ovr或者multinomial"
}
}
`,
},
...
...
@@ -55,8 +56,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +65,14 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的逻辑回归算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
自变量:
$
{
values
.
independent_variables
?
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
正则化强度(
C
):
$
{
values
.
c
}
正则化类型(
penalty
):
$
{
values
.
penalty
}
优化算法(
solver
):
$
{
values
.
solver
}
最大迭代次数(
max_iter
):
$
{
values
.
max_iter
}
收敛阈值(
tol
):
$
{
values
.
tol
}
多分类策略(
multi_class
):
$
{
values
.
multi_class
}
返回格式示例:
json
{
...
...
@@ -98,11 +101,6 @@ json
const
[
step
,
setStep
]
=
useState
<
number
>
(
-
1
)
const
options
=
[
{
label
:
'True'
,
value
:
true
},
{
label
:
'False'
,
value
:
false
},
]
// 处理下一步按钮逻辑
const
handleNext
=
async
()
=>
{
await
form
.
validateFields
()
...
...
@@ -311,9 +309,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/svm/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,12 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个支持向量机算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
特征列:
${
values
.
independent_variables
?.
join
(
', '
)}
目标列:
$
{
values
.
dependent_variable
}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
c"
:
"正则化参数(C)"
,
"kernel"
:
"核函数类型(kernel)"
,
"gamma"
:
"核函数系数(gamma)"
,
"degree"
:
"多项式核次数(degree)"
,
"class_weight"
:
"类别权重(class_weight)"
}
}
`,
},
...
...
@@ -55,8 +56,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +65,13 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的支持向量机算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
特征列:
$
{
values
.
independent_variables
?.
join
(
', '
)}
目标列:
$
{
values
.
dependent_variable
}
正则化参数(
C
):
$
{
values
.
c
}
核函数类型(
kernel
):
$
{
values
.
kernel
}
核函数系数(
gamma
):
$
{
values
.
gamma
}
多项式核次数(
degree
):
$
{
values
.
degree
}
类别权重(
class_weight
):
$
{
values
.
class_weight
}
返回格式示例:
json
{
...
...
@@ -266,9 +268,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
src/modules/data/digging/tree/components/ButtonModal.tsx
浏览文件 @
5dd0659f
...
...
@@ -16,7 +16,9 @@ export default function ButtonModal() {
const
{
post
,
isLoading
}
=
useAI
()
// AI设置
const
handleAISet
=
()
=>
{
const
handleAISet
=
async
()
=>
{
await
form
.
validateFields
([
'independent_variables'
,
'dependent_variable'
])
const
values
=
form
.
getFieldsValue
()
post
(
{
...
...
@@ -25,13 +27,12 @@ export default function ButtonModal() {
{
role
:
'user'
,
content
:
`根据提供的数据集,设计一个决策树(二分类)算法,返回JSON格式。
自变量:
${
values
.
independent_variables
.
join
(
', '
)}
因变量:
${
values
.
dependent_variable
}
分别返回是否拟合截距项(fit_intercept):true/false、是否复制数据(copy_x):true/false、并行计算核心数(n_jobs):None(单线程)或 ≥1 的整数(如 -1 表示使用所有核心)、强制正系数(positive):true/false的值。
特征列
${
values
.
independent_variables
?.
join
(
', '
)}
目标列:
$
{
values
.
dependent_variable
}
返回格式示例:
json
{
"results": { "
fit_intercept": true, "copy_x": true, "n_jobs": 1, "positive": false
}
"results"
:
{
"
max_depth"
:
"树的最大深度(max_depth)"
,
"min_samples_split"
:
"节点分裂最小样本数(min_samples_split)"
,
"min_samples_leaf"
:
"叶节点最小样本数(min_samples_leaf)"
,
"criterion"
:
"分裂标准(criterion)"
,
"max_features"
:
"最大特征数(max_features)"
}
}
`,
},
...
...
@@ -55,8 +56,8 @@ json
const [results, setResults] = useState<any>({})
const code = `
$
{
results
.
code
?.
replace
(
/
\\
n/gi
,
'
\
n'
)}
`
const [openResults, setOpenResults] = useState(false)
const handleAICompute = () => {
const values =
form.getFieldsValue
()
const handleAICompute =
async
() => {
const values =
await form.validateFields
()
post(
{
response_format: { type: 'json_object' },
...
...
@@ -64,12 +65,13 @@ json
{
role: 'user',
content: `
根据提供的数据集,设置的决策树(二分类)算法进行试算检查,返回
JSON
格式。
自变量:
$
{
values
.
independent_variables
.
join
(
', '
)}
因变量:
$
{
values
.
dependent_variable
}
是否拟合截距项(
fit_intercept
):
$
{
values
.
fit_intercept
}
是否复制数据(
copy_X
):
$
{
values
.
copy_x
}
并行计算核心数(
n_jobs
):
$
{
values
.
n_jobs
}
强制正系数(
positive
):
$
{
values
.
positive
}
特征列
$
{
values
.
independent_variables
?.
join
(
', '
)}
目标列:
$
{
values
.
dependent_variable
}
树的最大深度(
max_depth
):
$
{
values
.
max_depth
}
节点分裂最小样本数(
min_samples_split
):
$
{
values
.
min_samples_split
}
叶节点最小样本数(
min_samples_leaf
):
$
{
values
.
min_samples_leaf
}
分裂标准(
criterion
):
$
{
values
.
criterion
}
最大特征数(
max_features
):
$
{
values
.
max_features
}
返回格式示例:
json
{
...
...
@@ -259,9 +261,9 @@ json
{
current
===
0
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
async
()
=>
{
await
handleAICompute
()
setOpenResults
(
true
)
handleAICompute
()
}
}
loading=
{
isLoading
}
>
AI检查试算
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论