Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
ZZDataAnalysis
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlwu
ZZDataAnalysis
Commits
748af152
Commit
748af152
authored
Mar 13, 2024
by
whlviolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
061f6de1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1076 additions
and
2 deletions
+1076
-2
app.py
cieccproject/app.py
+28
-2
Lasso回归.csv
cieccproject/data/Lasso回归.csv
+0
-0
OLS.json
cieccproject/data/OLS.json
+1
-0
lasso.json
cieccproject/data/lasso.json
+1
-0
data.js
web/src/api/data.js
+19
-0
echartsUtil.js
web/src/utils/echartsUtil.js
+80
-0
sysAllData.vue
web/src/views/algorithmModel/components/sysAllData.vue
+313
-0
detail.vue
web/src/views/dataHander/components/detail.vue
+98
-0
sysAllData.vue
web/src/views/dataHander/components/sysAllData.vue
+536
-0
No files found.
cieccproject/app.py
View file @
748af152
...
...
@@ -105,9 +105,9 @@ def getRSRList():
def
getDEAList
():
filepath
=
""
if
(
request
.
args
[
"type"
]
==
'CCR'
):
filepath
=
"
D:
\
EarthDataMiner
\
project
\
ZXDataAnalysis
\
demo
\
AHP
\
DEA_CCR.json"
filepath
=
"
data/
DEA_CCR.json"
else
:
filepath
=
"
D:
\
EarthDataMiner
\
project
\
ZXDataAnalysis
\
demo
\
AHP
\
DEA_BBC.json"
filepath
=
"
data/
DEA_BBC.json"
with
open
(
filepath
,
'r'
,
encoding
=
'UTF-8'
)
as
f
:
res
=
f
.
read
()
print
(
type
(
res
))
...
...
@@ -135,7 +135,33 @@ def getDEAList():
dea1.summary()
res = dea1.to_json()
'''
@
app
.
route
(
"/getLassoRegression"
,
methods
=
[
"GET"
,
"POST"
])
def
getLassoRegression
():
filepath
=
"data/lasso.json"
with
open
(
filepath
,
'r'
,
encoding
=
'UTF-8'
)
as
f
:
res
=
f
.
read
()
print
(
type
(
res
))
print
(
res
)
result
=
{
"code"
:
200
,
"msg"
:
"success"
,
"data"
:
res
}
return
jsonify
(
result
)
@
app
.
route
(
"/getOLS"
,
methods
=
[
"GET"
,
"POST"
])
def
getOLS
():
filepath
=
"data/OLS.json"
with
open
(
filepath
,
'r'
,
encoding
=
'UTF-8'
)
as
f
:
res
=
f
.
read
()
print
(
type
(
res
))
print
(
res
)
result
=
{
"code"
:
200
,
"msg"
:
"success"
,
"data"
:
res
}
return
jsonify
(
result
)
if
__name__
==
"__main__"
:
app
.
run
(
debug
=
True
,
port
=
8001
)
...
...
cieccproject/data/Lasso回归.csv
0 → 100644
View file @
748af152
This diff is collapsed.
Click to expand it.
cieccproject/data/OLS.json
0 → 100644
View file @
748af152
[{
"name"
:
"线性回归分析结果表"
,
"value"
:
{
"n"
:
100
,
"intercept and coef name"
:
[
"常数"
,
"Q14-做功"
,
"Q15-日常锻炼情况"
,
"Q16-吃零食情况"
,
"Q17-跑步情况"
,
"Q18-玩电脑游戏情况"
,
"Q19-逛街情况"
,
"Q20-散步情况"
,
"Q21-夜宵情况"
],
"非标准化系数"
:
{
"B"
:
[
24.40130009421884
,
0.19262153327942105
,
-0.7305684152690275
,
0.420598696162354
,
-1.6929872427089208
,
0.627345706064012
,
0.370522584477988
,
-0.13466999546083103
,
2.5479398189917184
],
"标准差"
:
[
5.22992754140875
,
0.018578844457831933
,
1.1328979166523963
,
0.9051201010269613
,
1.0149530242046778
,
1.1004777146781501
,
1.245295268653324
,
0.930574770490926
,
1.483982450286351
]},
"标准化系数"
:
{
"Beta"
:
[
0.7213624553988669
,
-0.05843961687248622
,
0.03653916652566736
,
-0.14717695630974797
,
0.05029679332372762
,
0.026198972405919452
,
-0.01158697670584876
,
0.14784902329513774
]},
"t"
:
[
4.665705194004663
,
10.367788681185779
,
-0.6448669421405474
,
0.4646882725122745
,
-1.6680449265477622
,
0.570066706209937
,
0.29753793642745885
,
-0.14471700687714292
,
1.7169608835334036
],
"P"
:
[
1.053059053389287e-05
,
4.362276639130463e-17
,
0.5206358467941066
,
0.6432646441232268
,
0.09874445573562211
,
0.5700372353378148
,
0.7667340382284769
,
0.8852543465439333
,
0.08938816463174061
],
"VIF"
:
[
1.047943666155264
,
1.7777784289836556
,
1.338434090167112
,
1.6852614558054069
,
1.6851260044506124
,
1.6783671176969834
,
1.3877277255568892
,
1.6051634360888174
],
"R**2"
:
0.5796236726178019
,
"调整R**2"
:
0.5426675119688175
,
"F"
:
{
"F"
:
15.684087914953095
,
"P"
:
2.7363837020628006e-14
},
"因变量"
:
"Q6-体重kg"
},
"text"
:
{
"图表说明"
:
"上表格展示了本次模型的分析结果,包括模型的标准化系数、t值、VIF值、R²、调整R²等,用于模型的检验,并分析模型的公式。
\n
1. 线性回归模型要求总体回归系数不为0,即变量之间存在回归关系。根据F检验结果对模型进行检验。
\n
2. R²代表曲线回归的拟合程度,越接近1效果越好。
\n
3. VIF值代表多重共线性严重程度,用于检验模型是否呈现共线性,即解释变量间存在高度相关的关系(VIF应小于10或者5,严格为5)若VIF出现inf,则说明VIF值无穷大,建议检查共线性,或者使用岭回归。
\n
4. B是有常数情况下的的系数。
\n
5. 标准误=B/t值。
\n
6. 标准化系数是将数据标准化后得到的系数。
\n
7. VIF是共线性。
\n
8. F(df1,df2)是df1等于自变量数量;df2等于样本量-(自变量数量+1)。
\n
9. F检验是为了判断是否存在显著的线性关系,R²是为了判断回归直线与此线性模型拟合的优劣。在线性回归中主要关注F检验是否通过,而在某些情况下R²大小和模型解释度没有必然关系。"
,
"智能分析"
:
"F检验的结果分析可以得到,显著性P值为0.000,水平上呈现显著性,拒绝回归系数为0的原假设,因此模型基本满足要求。
\n
对于变量共线性表现,VIF全部小于10,因此模型没有多重共线性问题,模型构建良好。
\n
模型的公式如下:y=24.401 + 0.193*Q14-做功 - 0.731*Q15-日常锻炼情况 + 0.421*Q16-吃零食情况 - 1.693*Q17-跑步情况 + 0.627*Q18-玩电脑游戏情况 + 0.371*Q19-逛街情况 - 0.135*Q20-散步情况 + 2.548*Q21-夜宵情况 。"
}},
{
"name"
:
"拟合效果图"
,
"value"
:
{
"x"
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
64
,
65
,
66
,
67
,
68
,
69
,
70
,
71
,
72
,
73
,
74
,
75
,
76
,
77
,
78
,
79
,
80
,
81
,
82
,
83
,
84
,
85
,
86
,
87
,
88
,
89
,
90
,
91
,
92
,
93
,
94
,
95
,
96
,
97
,
98
,
99
],
"真实值"
:
[
54.5
,
65.0
,
58.5
,
52.9
,
60.2
,
57.5
,
67.1
,
47.0
,
60.5
,
42.8
,
53.7
,
38.3
,
63.0
,
36.1
,
57.0
,
55.1
,
48.0
,
53.7
,
58.6
,
30.0
,
44.4
,
45.0
,
50.0
,
62.5
,
43.6
,
44.5
,
59.5
,
40.4
,
57.0
,
50.5
,
37.5
,
56.3
,
62.1
,
51.5
,
52.0
,
66.6
,
63.5
,
50.0
,
60.5
,
65.0
,
57.3
,
26.6
,
32.5
,
62.9
,
55.0
,
40.9
,
50.2
,
61.9
,
51.0
,
52.5
,
48.3
,
42.0
,
47.0
,
57.2
,
50.0
,
36.5
,
30.2
,
52.1
,
56.2
,
54.0
,
78.3
,
46.0
,
61.0
,
63.2
,
34.9
,
41.8
,
65.0
,
54.0
,
63.0
,
41.8
,
36.8
,
50.0
,
32.5
,
73.0
,
44.0
,
28.0
,
34.0
,
48.5
,
47.5
,
48.5
,
41.0
,
67.0
,
62.5
,
63.3
,
51.2
,
46.0
,
45.0
,
25.5
,
51.7
,
55.0
,
55.0
,
54.4
,
47.0
,
57.0
,
37.7
,
45.0
,
53.0
,
52.5
,
34.1
,
40.2
],
"预测值"
:
[
60.96758166246284
,
65.4673089711356
,
50.434065167565535
,
53.58256795693698
,
62.243832123520846
,
59.34087808648165
,
64.62709720555604
,
48.273617218722634
,
65.65367475067012
,
46.925238845494306
,
56.19757484430131
,
48.00985403493017
,
60.59047983133322
,
45.11309990692115
,
49.793221750669204
,
58.665931379193836
,
47.06891556427897
,
57.879044615481305
,
53.74765844807298
,
39.1588988478713
,
43.010678120680325
,
47.19454177202918
,
54.07358990856969
,
73.51538472497953
,
50.11570014397114
,
43.8705363933502
,
53.595666265590644
,
48.80206847212683
,
56.847051744265826
,
44.909367534711464
,
46.72882002405326
,
48.206693809416734
,
48.497251073109716
,
45.23213642874133
,
56.12757251272547
,
49.79415991594871
,
57.24596495808484
,
48.48034606808392
,
51.76612309204627
,
49.82181068422105
,
50.36186314357572
,
34.902894888666495
,
42.31157593833729
,
57.07248768951406
,
43.80307955226056
,
44.869296737600116
,
44.86334773242538
,
48.52147405191554
,
48.944825524492686
,
49.034927344299604
,
40.73053361843338
,
45.35582831108174
,
43.363323297609
,
62.11265474950305
,
46.14861479068929
,
42.0504260418667
,
38.11556752876169
,
44.79257376147541
,
63.816120615671515
,
59.452598292203824
,
64.46627615930407
,
51.895329368777524
,
59.466898257152906
,
56.34532094271201
,
43.90397593049274
,
46.98498245074258
,
71.98339157969592
,
59.1593876381692
,
64.22862340923433
,
45.23191106731207
,
41.15771304107032
,
46.62352753135051
,
41.13666475904604
,
53.09857402802325
,
49.160599672166605
,
37.722503625896564
,
42.713457110841205
,
47.42797193017334
,
49.109780155351636
,
46.95820568840233
,
46.09797555828173
,
61.51866350858046
,
56.03572815592926
,
71.44923154905497
,
47.798672805180054
,
43.74085526742688
,
53.44445340344848
,
37.655010270773126
,
53.18129845908712
,
57.999156948187846
,
52.16715419926452
,
42.789170538247674
,
43.88788574722746
,
56.44832351765272
,
42.05391994326932
,
45.363720861649064
,
42.38407520695003
,
46.62357350820484
,
40.584214873128204
,
39.90180286372068
]},
"text"
:
"上图展示了本次模型的原始数据图、模型拟合值、模型预测值。"
},
{
"name"
:
"模型路径图"
,
"value"
:
{
"coef name"
:
[
"Q14-做功"
,
"Q15-日常锻炼情况"
,
"Q16-吃零食情况"
,
"Q17-跑步情况"
,
"Q18-玩电脑游戏情况"
,
"Q19-逛街情况"
,
"Q20-散步情况"
,
"Q21-夜宵情况"
],
"coef"
:
[
0.7213624553988669
,
-0.05843961687248622
,
0.03653916652566736
,
-0.14717695630974797
,
0.05029679332372762
,
0.026198972405919452
,
-0.01158697670584876
,
0.14784902329513774
],
"y"
:
"Q6-体重kg"
},
"text"
:
"上图以路径图形式展示了本次模型结果,主要包括模型的系数,用于分析X对于Y的影响关系情况。"
},
{
"name"
:
"模型结果预测"
,
"value"
:
{
"变量"
:
[
"常数"
,
"Q14-做功"
,
"Q15-日常锻炼情况"
,
"Q16-吃零食情况"
,
"Q17-跑步情况"
,
"Q18-玩电脑游戏情况"
,
"Q19-逛街情况"
,
"Q20-散步情况"
,
"Q21-夜宵情况"
],
"系数"
:
[
24.40130009421884
,
0.19262153327942105
,
-0.7305684152690275
,
0.420598696162354
,
-1.6929872427089208
,
0.627345706064012
,
0.370522584477988
,
-0.13466999546083103
,
2.5479398189917184
]},
"text"
:
"上表格显示了线性回归模型的预测情况。"
}]
\ No newline at end of file
cieccproject/data/lasso.json
0 → 100644
View file @
748af152
[{
"name"
:
"模型系数表"
,
"value"
:
{
"变量名"
:
[
"截距"
,
"age"
,
"sex"
,
"bmi"
,
"bp"
,
"s1"
,
"s2"
,
"s3"
,
"s4"
,
"s5"
,
"s6"
],
"标准化系数"
:
[
-1.42291888301942e-16
,
-0.04930485283754814
,
-0.10528742373527387
,
0.3950480630066243
,
0.1494990345857754
,
-0.04029857240418088
,
-0.13038008846830637
,
-0.00213936532567927
,
0.07129263179793234
,
0.2948622954448755
,
0.035973813487822186
],
"非标准化系数"
:
[
152.145224976732
,
-97.03657107238281
,
-213.10441775769348
,
597.1994529364002
,
285.6014120876411
,
-36.947999079549746
,
-309.8807159996562
,
-0.0
,
205.83054405466544
,
466.9144818817507
,
67.4125041702004
],
"R²"
:
0.5003669473423848
},
"text"
:
{
"图表说明"
:
"上表展示了模型系数情况,当模型中标准化变量系数为0时,代表这个变量被排除出模型。"
,
"智能分析"
:
"Lasso回归的结果显示:基于变量截距项、age、sex、bmi、bp、s1、s2、s3、s4、s5、s6的标准化系数,变量截距项、age、sex、bmi、bp、s1、s2、s3、s4、s5、s6被保留,没有变量被删除。
\n
模型的标准化公式:y=-0.0-0.049 × age-0.105 × sex+0.395 × bmi+0.149 × bp-0.04 × s1-0.13 × s2-0.002 × s3+0.071 × s4+0.295 × s5+0.036 × s6。
\n
模型的非标准化公式:y=152.145-97.037 × age-213.104 × sex+597.199 × bmi+285.601 × bp-36.948 × s1-309.881 × s2+0.0 × s3+205.831 × s4+466.914 × s5+67.413 × s6。"
}},
{
"name"
:
"模型结果图"
,
"value"
:
{
"x"
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
64
,
65
,
66
,
67
,
68
,
69
,
70
,
71
,
72
,
73
,
74
,
75
,
76
,
77
,
78
,
79
,
80
,
81
,
82
,
83
,
84
,
85
,
86
,
87
,
88
,
89
,
90
,
91
,
92
,
93
,
94
,
95
,
96
,
97
,
98
,
99
],
"真实值"
:
[
151
,
135
,
138
,
110
,
101
,
171
,
166
,
144
,
97
,
168
,
68
,
49
,
68
,
245
,
184
,
202
,
137
,
85
,
131
,
283
,
59
,
341
,
87
,
102
,
265
,
276
,
100
,
61
,
92
,
259
,
53
,
75
,
142
,
225
,
59
,
182
,
128
,
52
,
37
,
170
,
128
,
163
,
150
,
178
,
48
,
202
,
111
,
85
,
42
,
170
,
200
,
113
,
143
,
52
,
65
,
141
,
55
,
134
,
111
,
98
,
164
,
96
,
90
,
162
,
150
,
279
,
92
,
83
,
128
,
302
,
198
,
95
,
53
,
134
,
81
,
104
,
258
,
229
,
275
,
200
,
200
,
84
,
121
,
161
,
109
,
115
,
268
,
274
,
158
,
107
,
83
,
103
,
272
,
85
,
280
,
336
,
118
,
235
,
174
,
259
],
"预测值"
:
[
200.73867554581406
,
122.06071695336558
,
82.09942294560125
,
154.53215575880554
,
107.74659322113223
,
158.20156685490898
,
226.21492367085517
,
160.98433482860676
,
145.84841678807229
,
129.68314955301102
,
122.48305928057587
,
103.17444084771823
,
125.02506046869433
,
281.8052534377463
,
173.3075323511796
,
141.70126522733136
,
115.52353826511843
,
190.27267237658208
,
123.58001215301985
,
196.04524970973898
,
83.71443725009021
,
251.2862558507702
,
133.46155412385787
,
103.72383060499753
,
213.42652649807692
,
166.4793756230214
,
136.634179995953
,
142.1055565567197
,
97.13974194928144
,
207.75767687601103
,
115.82644049459384
,
73.89434903135816
,
181.15649050234526
,
161.01405079596472
,
134.29097564169632
,
150.55884377506288
,
94.37616783310582
,
208.55371302213865
,
101.24475824694733
,
127.41546215035282
,
91.35269729889399
,
178.80976452805368
,
135.07191982202346
,
121.97399198818746
,
84.62839647870965
,
147.98204333443238
,
113.54195034965385
,
149.87038292250128
,
121.1743876064352
,
195.85530214064627
,
95.18591512211869
,
101.34724656302866
,
165.9339551032655
,
81.82677946988389
,
68.44983194456395
,
168.7407136093325
,
50.57045493397307
,
158.80502410469404
,
118.30336819861091
,
100.16760974645949
,
176.29517853500556
,
74.73935443622756
,
126.14087383154649
,
120.96425655307901
,
197.51861978005286
,
209.70086601845765
,
123.87338923917765
,
122.89973665953357
,
164.78495232629461
,
163.26158382658463
,
139.96085547789878
,
167.77237000888655
,
112.04317685167814
,
83.94575895438615
,
126.41614786179775
,
59.92349573663044
,
305.127775611591
,
187.41722189542259
,
203.85055870989564
,
151.8404367274107
,
158.98494881720148
,
144.37970080901297
,
175.64459982702974
,
194.77426907407215
,
115.1195718344502
,
96.55519933013136
,
201.57755150468182
,
251.4065864092679
,
78.64602152901436
,
103.39536302253309
,
83.44014627755666
,
160.839342613944
,
235.81944617168085
,
80.60454954392486
,
230.9222490137974
,
255.6127217814594
,
144.4869352463721
,
160.59576220522231
,
163.20496193395977
,
252.83330168744084
]},
"text"
:
"上图展示了本次模型的原始数据图、模型拟合值、模型预测值。"
},
{
"name"
:
"模型结果预测"
,
"value"
:
{
"变量"
:
[
"截距"
,
"age"
,
"sex"
,
"bmi"
,
"bp"
,
"s1"
,
"s2"
,
"s3"
,
"s4"
,
"s5"
,
"s6"
],
"系数"
:
[
152.145224976732
,
-97.03657107238281
,
-213.10441775769348
,
597.1994529364002
,
285.6014120876411
,
-36.947999079549746
,
-309.8807159996562
,
-0.0
,
205.83054405466544
,
466.9144818817507
,
67.4125041702004
]},
"text"
:
"上表格显示了经过Lasso回归后的模型预测情况。"
}]
\ No newline at end of file
web/src/api/data.js
View file @
748af152
...
...
@@ -187,4 +187,23 @@ export function getDEAList(params) {
})
}
export
function
getLassoRegression
(
params
)
{
return
request
({
url
:
"http://localhost:8001/getLassoRegression"
,
method
:
'get'
,
params
})
}
export
function
getOLSList
(
params
)
{
return
request
({
url
:
"http://localhost:8001/getOLS"
,
method
:
'get'
,
params
})
}
web/src/utils/echartsUtil.js
View file @
748af152
...
...
@@ -209,3 +209,83 @@ export function getOptionByDEA(res) {
};
return
option
;
}
export
function
getOptionByLasso
(
res
)
{
let
seriesList
=
[]
let
leg
=
[]
let
header
=
[
'真实值'
,
'预测值'
]
let
data
=
res
[
'value'
]
//["决策单元",'技术效益(BCC)','规模效益(CCR/BCC)','综合技术效益(CCR)']
let
col
=
res
[
'x'
]
// let realData = data['真实值']
// let analysisData = data['预测值']
for
(
let
i
in
header
){
let
litem
=
header
[
i
]
let
datalist
=
data
[
litem
]
let
obj
=
{
name
:
litem
,
type
:
'line'
,
data
:
datalist
,
symbol
:
'none'
,
}
seriesList
.
push
(
obj
)
}
console
.
log
(
col
)
console
.
log
(
seriesList
)
let
option
=
{
title
:
{
text
:
''
},
tooltip
:
{
trigger
:
'axis'
,
position
:
function
(
pt
)
{
return
[
pt
[
0
],
'20%'
];
},
valueFormatter
:
(
value
)
=>
parseFloat
(
value
).
toFixed
(
Number
(
3
))
},
legend
:
{
data
:
header
},
dataZoom
:
[
{
type
:
'inside'
,
start
:
0
,
end
:
100
},
{
start
:
0
,
end
:
100
}
],
grid
:
{
left
:
'3%'
,
right
:
'4%'
,
// bottom: '3%',
containLabel
:
true
},
toolbox
:
{
feature
:
{
dataZoom
:
{
yAxisIndex
:
'none'
},
restore
:
{},
saveAsImage
:
{}
}
},
xAxis
:
{
type
:
'category'
,
boundaryGap
:
false
,
data
:
col
},
yAxis
:
{
type
:
'value'
,
min
:
"dataMin"
,
max
:
"dataMax"
,
boundaryGap
:
[
0
,
'100%'
]
},
series
:
seriesList
};
return
option
;
}
web/src/views/algorithmModel/components/sysAllData.vue
0 → 100644
View file @
748af152
<
template
>
<div
style=
"height:100%;width:100%"
>
<div
style=
"height: 100%;position:relative;"
>
<div
style=
"height:41px;line-height:41px; font-size:16px;font-weight:600;border-bottom:1px solid #e3e3e3"
>
<span
style=
"margin-left:30px"
>
{{
algoName
}}
</span>
</div>
<div
style=
"position: absolute; top: 41px; right:0px; left:0px; bottom:0px;overflow: scroll;"
>
<div
style=
"padding-bottom: 100px;"
>
<div
style=
"width: 100%; height:100%;margin:10px 30px;"
>
<span
style=
"font-weight:600;font-size:14px"
>
示例代码
</span>
<div
style=
"margin: 5px 0px "
>
<div
class=
"editor-box"
>
<Vue2CodemirrorMarkdown
ref=
"editor"
v-model=
"algoDes"
:indentUnit=
"2"
:fullscreen=
"false"
:hljsCss=
"hljsCss"
:imageUploader=
"imageObj"
tocPosition=
""
@
on-save=
"handleOnSave"
:toolbar=
"toolbar"
:config=
"
{
lineNumbers: true,
}"
:showToolbar="true"
@on-change="handleOnChange"
/>
</div>
</div>
</div>
<div
style=
"align-items: flex-end;margin-right:15px;margin-top:10px;margin-left:30px"
>
<el-button
type=
"primary"
style=
"width:200px;background-color: #0078D4"
@
click=
"handleClose"
>
在分析工具中打开该算法
</el-button>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
{
getyear
,
getAddress
,
detDataTitle
,
getIndustry
,
getCondition
,
getTree
,
saveTempFile
,
createProject
}
from
'@/api/data'
import
{
getOption
}
from
"@/utils/echartsUtil"
import
VabChart
from
'@/plugins/echarts'
import
VueMarkdown
from
'vue-markdown'
import
Vue2CodemirrorMarkdown
from
'vue2-codemirror-markdown'
// Markdown preview
import
md
from
"vue2-codemirror-markdown/src/lib/core/markdown"
import
MkPreview
from
"vue2-codemirror-markdown/src/components/preview/mk-preview"
export
default
{
name
:
'Index'
,
components
:
{
VabChart
,
Vue2CodemirrorMarkdown
,
md
,
MkPreview
},
data
()
{
return
{
props
:
{
label
:
'name'
,
children
:
'zones'
,
isLeaf
:
'leaf'
},
hljsCss
:
"darcula"
,
theme
:
'base16-light'
,
content
:
""
,
algdoc
:
{
display
:
"display"
},
imageObj
:
{
url
:
"http://127.0.0.1:82/upload"
,
data
:
{},
header
:
{},
accept
:
'image/*'
,
onChange
:
(
data
)
=>
{
console
.
log
(
data
)
},
onreadystatechange
:
(
xhr
,
e
)
=>
{
console
.
log
(
xhr
,
e
)
}
},
toolbar
:
{
editable
:
false
,
bold
:
true
,
// 粗体
italic
:
true
,
// 斜体
header
:
true
,
// 标题
underline
:
true
,
// 下划线
strikethrough
:
true
,
// 中划线
mark
:
true
,
// 标记
superscript
:
true
,
// 上角标
subscript
:
true
,
// 下角标
quote
:
true
,
// 引用
ol
:
true
,
// 有序列表
ul
:
true
,
// 无序列表
link
:
true
,
// 链接
imagelink
:
true
,
// 图片链接
code
:
true
,
// code
table
:
true
,
// 表格
fullscreen
:
true
,
// 全屏编辑
readmodel
:
true
,
// 沉浸式阅读
htmlcode
:
true
,
// 展示html源码
help
:
true
,
// 帮助
/* 1.3.5 */
undo
:
true
,
// 上一步
redo
:
true
,
// 下一步
trash
:
true
,
// 清空
save
:
true
,
// 保存(触发events中的save事件)
/* 1.4.2 */
navigation
:
true
,
// 导航目录
/* 2.1.8 */
alignleft
:
true
,
// 左对齐
aligncenter
:
true
,
// 居中
alignright
:
true
,
// 右对齐
/* 2.2.1 */
subfield
:
false
,
// 单双栏模式
preview
:
true
,
// 预览
},
algoName
:
''
,
activeNames
:
"1"
,
idxData
:
[],
defaultProps
:
{
children
:
'children'
,
label
:
'name'
},
dataTitle
:
[],
address
:
[],
industry
:
[],
times
:
[
],
condition
:
{
dataCondition
:
[],
address
:
[],
years
:
[],
industry
:
[]
},
params
:
{
dataCondition
:
[],
address
:
[],
years
:
[],
industry
:
[],
algo
:
'pearson'
},
resultData
:
false
,
tableData
:
[],
tableHeader
:
[],
fwl
:
{},
options
:
[{
value
:
'pearson'
,
label
:
'关联分析-Pearson'
},
{
value
:
'spearman'
,
label
:
'关联分析—Spearman'
},
{
value
:
'kendall'
,
label
:
'关联分析—Kendall'
}],
algo
:
''
,
algoRes
:
{},
saveFileName
:
""
,
saveFlag
:
false
,
}
},
mounted
()
{
console
.
log
(
"加载"
);
this
.
init
();
// this.algoDes= md.render(this.algoDes)
},
methods
:
{
handleNodeClick
(
obj
)
{
this
.
checkDataTitle
(
obj
)
},
handleOnSave
(){
},
handleOnChange
(){
},
handleClose
(){
},
init
()
{
this
.
algoName
=
'秩和比综合评价法(RSR)'
this
.
algoDes
=
'```py
\
n'
+
'import numpy
\
n'
+
'import pandas
\
n'
+
'from zzdataanalysis.algorithm import analysis
\
n'
+
'#生成案例数据
\
n'
+
'data = pandas.DataFrame({
\
n'
+
' "A": [1, 2, 3, 4, 5]
\
n'
+
'})
\
n'
+
'positive_columns = pandas.DataFrame({
\
n'
+
' "A": [1, 2, 3, 4, 5]
\
n'
+
'})
\
n'
+
'negative_columns = pandas.DataFrame({
\
n'
+
' "A": [1, 2, 3, 4, 5]
\
n'
+
'})
\
n'
+
'index_columns = 1
\
n'
+
"weight_type=
\
'entropy_method
\
'
\n
"
+
"rank_make_method=
\
'integer_rank
\
'
\n
"
+
"number_bins=3
\n
"
+
'print(analysis.rsr(data, positive_columns, negative_columns,index_columns,weight_type,rank_make_method,number_bins))
\
n'
+
'```
\
n'
},
}
}
</
script
>
<
style
scoped
>
.center
{
width
:
100%
;
display
:
flex
;
background
:
#f5f5f5
;
}
.left
{
width
:
18%
;
height
:
100%
;
background
:
white
;
padding-right
:
10px
;
border-right
:
1px
solid
#e1e1e1
;
border-bottom
:
1px
solid
#e7e7e7
;
padding
:
0
0px
0
17px
;
}
.right
{
width
:
18%
;
height
:
100%
;
background
:
#dcfaff
;
display
:
flex
;
flex-direction
:
column
;
border-right
:
1px
solid
#e1e1e1
;
}
.right
.entry
{
height
:
30%
;
display
:
flex
;
flex-direction
:
column
;
background-color
:
#ffffff
;
}
.right
.entry
.header
{
height
:
41px
;
background
:
#004a6447
;
/* box-shadow: 3px 0px 4px #8b8b8b; */
line-height
:
41px
;
padding-left
:
20px
;
position
:
inherit
;
color
:
#545454
;
font-weight
:
700
;
}
.right
.entry
.body
{
flex
:
1
;
overflow-y
:
scroll
;
padding-left
:
20px
;
}
.result
{
width
:
100%
;
background
:
#fbfbfb
}
.result
.header
{
width
:
100%
;
height
:
40px
;
line-height
:
40px
;
font-weight
:
600
;
background
:
#358FD4
;
border-radius
:
2px
;
}
.right
.btn
:hover
{
cursor
:
pointer
;
}
</
style
>
<
style
>
.left
.el-collapse-item__content
{
padding-bottom
:
7px
;
font-size
:
13px
;
color
:
#303133
;
line-height
:
1.7692307692
;
}
.left
.el-collapse-item__header
{
height
:
41px
;
line-height
:
41px
;
}
/*color: rgba(0, 0, 0, .87);*/
/* markdown preview css */
.algDoc-content
.markdown-body
{
color
:
inherit
!important
;
padding
:
20px
0
!important
;
}
.algDoc-content
.markdown-body
table
{
color
:
#000
!important
;
}
.algDoc
.algDoc-content
{
font-weight
:
400
;
line-height
:
1.5rem
;
font-family
:
"Nunito Sans"
,
Helvetica
,
sans-serif
;
margin-bottom
:
1rem
;
/*color: rgba(0, 0, 0, .87);*/
}
.editor-box
{
height
:
62vh
;
}
</
style
>
web/src/views/dataHander/components/detail.vue
0 → 100644
View file @
748af152
<
template
>
<div
style=
"height: 100%;display: flex; flex-direction: column;"
>
<div
style=
"background:#e8f1f2"
>
<vab-breadcrumb
class=
"hidden-xs-only"
:style=
"
{'height':'30px', 'line-height':'30px', 'margin-left':'20px'}"/>
</div>
<div
style=
"width:100%;height:100%;position: relative;background: white;"
>
<div
style=
"flex: 1;display: flex;width: 100%;height: 100%;flex-direction: column;"
>
<div
style=
"height:5%; font-size:16px; font-weight:600;margin-top:10px"
>
<span
style=
"margin-left: 20px"
>
通用方法:
</span>
</div>
<div
style=
"height:5%; font-size:14px;"
>
<div
class=
"entry"
style=
"margin-left: 100px;height:25%;width: 100%;border-right: 3px "
>
<div
class=
"body"
style=
"border-right: 3px solid ;"
>
<template
v-for=
"(item, index) in industry"
>
<el-button
type=
"primary"
style=
"width:100px;background-color: #0094d4"
@
click=
"handleClose"
>
{{
item
.
name
}}
</el-button>
</
template
>
</div>
</div>
</div>
<div
style=
"height:5%; font-size:16px; font-weight:600;margin-top:10px;display: flex;flex-direction: row"
>
<div
style=
"align-items: flex-start;margin-right : auto"
>
<span
style=
"margin-left: 20px"
>
数据视图:
</span>
</div>
<div
style=
"align-items: flex-end;margin-right:15px"
>
<el-button
type=
"primary"
style=
"width:100px;background-color: #0078D4"
@
click=
"handleClose"
>
导出
</el-button>
</div>
</div>
<div
style=
"height:90%; margin-top:5px;margin-left:15px;margin-bottom:5px;margin-right:15px"
>
<el-table
border
height=
"100%"
:data=
"tableData"
:style=
"{'width': '100%'}"
>
<
template
v-for=
"item in tableHeader"
>
<el-table-column
:prop=
"item"
:label=
"item"
:sortable=
"true"
min-width=
"80"
>
</el-table-column>
</
template
>
</el-table>
</div>
</div>
</div>
</div>
</template>
<
script
>
import
{
readFile
}
from
'@/api/data'
export
default
{
data
()
{
return
{
tableData
:
[],
tableHeader
:
[],
industry
:[
{
key
:
'1'
,
name
:
'标准化'
},
{
key
:
'2'
,
name
:
'区间缩放'
},
{
key
:
'3'
,
name
:
'非线性转换'
},
{
key
:
'4'
,
name
:
'归一化'
},
{
key
:
'5'
,
name
:
'二值化'
},
{
key
:
'6'
,
name
:
'哑编码'
},
{
key
:
'7'
,
name
:
'缺失值计算'
},
{
key
:
'8'
,
name
:
'多项式转换'
},
{
key
:
'9'
,
name
:
'描述性统计'
},
{
key
:
'10'
,
name
:
'自定义转换'
},
],
}
},
mounted
()
{
console
.
log
(
"====="
)
console
.
log
(
this
.
$route
.
query
)
this
.
loadData
()
},
methods
:
{
handleClose
(){
},
loadData
()
{
this
.
tableData
=
[];
this
.
tableHeader
=
[]
let
name
=
this
.
$route
.
query
.
name
let
params
=
{
"fId"
:
this
.
$route
.
query
.
id
,
"name"
:
name
}
readFile
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
tableHeader
=
res
.
data
.
header
;
this
.
tableData
=
res
.
data
.
data
;
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
}
}
</
script
>
web/src/views/dataHander/components/sysAllData.vue
0 → 100644
View file @
748af152
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment