From 70e7ca033df3b9226976de49beeddc6777484c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E4=BD=B3=20=E5=8D=9A?= <12742597+fang-jiabo@user.noreply.gitee.com> Date: Mon, 19 Aug 2024 09:09:51 +0800 Subject: [PATCH] 'tj' --- src/api/AI.js | 8 + .../components/associationRuleMining.vue | 39 +- .../components/regressionAnalysis.vue | 538 ++++++++++++++++++ .../digitalMarketingAlgorithms/index.vue | 3 +- 4 files changed, 558 insertions(+), 30 deletions(-) create mode 100644 src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue diff --git a/src/api/AI.js b/src/api/AI.js index 612d6c4..45ffb26 100644 --- a/src/api/AI.js +++ b/src/api/AI.js @@ -64,4 +64,12 @@ export function associationRuleMining(data) { method: 'post', data:data, }) +} +//回归分析--线性回归 +export function linearRegression(data) { + return request({ + url: '/api/model/regressionAnalysis', + method: 'post', + data:data, + }) } \ No newline at end of file diff --git a/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue b/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue index 69ed7b8..6f489d8 100644 --- a/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue +++ b/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue @@ -119,7 +119,7 @@ 分析结果: 下载 - + @@ -188,6 +188,9 @@ const dialogVisible=ref(false) const tableLabel=reactive([ {prop:'date',label:''}, ]) +const tableLabel2=reactive([ + {prop:'date',label:''}, +]) const getList=()=>{ API.selectionMetrics({userId:JSON.parse(getUserInfo()).userId}).then((res)=>{ res.data.forEach(element => { @@ -312,39 +315,17 @@ const optionData2=()=>{ const computation=()=>{ if(input5.value&&input6.value&&input4.value){ const sendData={ - k:input5.value, - t:input6.value, + confidence:parseFloat(input5.value)/100, + support:parseFloat(input6.value)/100, userId:JSON.parse(getUserInfo()).userId, deduplicatedDataList:resTable2.value } - API.clusterAnalysisPlot(sendData).then((res)=>{ - showChart.value=true - let sex=1 + API.associationRuleMining(sendData).then((res)=>{ tableData3.value=[] - res.data.forEach((item,index)=>{ - const newItem = {}; - tableLabel.forEach((label,index) => { - if(index===0){ - newItem[label.prop] = '簇'+sex; // 动态设置字段名 - }else{ - newItem[label.prop] ='' - } - }); - newItem['TSuid']=sex - sex++ - tableData3.value.push(newItem); - tableData3.value[index].children=[] - const children=ref([]) - item.forEach((item2,sexx)=>{ - const newItem2 = {}; - tableLabel.forEach((label,index2) => { - newItem2[label.prop] = item2[index2]; // 动态设置字段名 - }); - newItem2['TSuid']=''+sex+sexx - children.value.push(newItem2) + res.data.forEach(element=>{ + tableData3.value.push({ + date:element }) - tableData3.value[index].children=children.value - console.log(tableData3.value); }) }) } diff --git a/src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue b/src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue new file mode 100644 index 0000000..0bd9253 --- /dev/null +++ b/src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue @@ -0,0 +1,538 @@ + + + + + + \ No newline at end of file diff --git a/src/views/digitalMarketingAlgorithms/index.vue b/src/views/digitalMarketingAlgorithms/index.vue index 5bb3a9d..233e6c3 100644 --- a/src/views/digitalMarketingAlgorithms/index.vue +++ b/src/views/digitalMarketingAlgorithms/index.vue @@ -21,8 +21,9 @@ import descriptiveStatistics from './components/descriptiveStatistics.vue' import clusterAnalysis from './components/clusterAnalysis.vue' import associationRuleMining from './components/associationRuleMining.vue' + import regressionAnalysis from './components/regressionAnalysis.vue' const component=ref(big) - const pageData=[big,descriptiveStatistics,clusterAnalysis,associationRuleMining] + const pageData=[big,descriptiveStatistics,clusterAnalysis,associationRuleMining,regressionAnalysis] const isActive=ref(1) const activeIndex=(index)=>{ isActive.value=index