Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
5ec248d8
Commit
5ec248d8
authored
Sep 03, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in divsion zero
parent
e683b114
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
grayStat.py
eda/gray_stat/grayStat.py
+7
-7
No files found.
eda/gray_stat/grayStat.py
View file @
5ec248d8
...
@@ -79,14 +79,14 @@ if __name__ == '__main__':
...
@@ -79,14 +79,14 @@ if __name__ == '__main__':
uid_count
=
g_class
.
get_uid_count
()
uid_count
=
g_class
.
get_uid_count
()
uid_clk_times
=
g_class
.
get_uid_clk_times
()
uid_clk_times
=
g_class
.
get_uid_clk_times
()
uid_imp_times
=
g_class
.
get_uid_imp_times
()
uid_imp_times
=
g_class
.
get_uid_imp_times
()
uid_clk_rate
=
round
(
uid_clk_times
/
uid_imp_times
,
4
)
uid_clk_rate
=
round
(
uid_clk_times
/
uid_imp_times
,
4
)
if
uid_imp_times
!=
0
else
0
result1
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
gray
,
uid_count
,
\
result1
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
gray
,
uid_count
,
\
uid_clk_times
,
uid_imp_times
,
uid_clk_rate
])
uid_clk_times
,
uid_imp_times
,
uid_clk_rate
])
result1
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
'all'
,
\
result1
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
'all'
,
\
result1
[
-
1
][
4
]
+
result1
[
-
2
][
4
],
\
result1
[
-
1
][
4
]
+
result1
[
-
2
][
4
],
\
result1
[
-
1
][
5
]
+
result1
[
-
2
][
5
],
\
result1
[
-
1
][
5
]
+
result1
[
-
2
][
5
],
\
result1
[
-
1
][
6
]
+
result1
[
-
2
][
6
],
\
result1
[
-
1
][
6
]
+
result1
[
-
2
][
6
],
\
round
((
result1
[
-
1
][
5
]
+
result1
[
-
2
][
5
])
/
(
result1
[
-
1
][
6
]
+
result1
[
-
2
][
6
]),
4
)])
round
((
result1
[
-
1
][
5
]
+
result1
[
-
2
][
5
])
/
(
result1
[
-
1
][
6
]
+
result1
[
-
2
][
6
]),
4
)])
if
(
result1
[
-
1
][
6
]
+
result1
[
-
2
][
6
])
!=
0
else
0
#1.2获取所有平台的数据
#1.2获取所有平台的数据
labels
=
[
'6'
,
'8'
,
'all'
]
labels
=
[
'6'
,
'8'
,
'all'
]
for
i
in
range
(
3
):
for
i
in
range
(
3
):
...
@@ -94,7 +94,7 @@ if __name__ == '__main__':
...
@@ -94,7 +94,7 @@ if __name__ == '__main__':
result1
[
i
][
4
]
+
result1
[
i
+
3
][
4
],
\
result1
[
i
][
4
]
+
result1
[
i
+
3
][
4
],
\
result1
[
i
][
5
]
+
result1
[
i
+
3
][
5
],
\
result1
[
i
][
5
]
+
result1
[
i
+
3
][
5
],
\
result1
[
i
][
6
]
+
result1
[
i
+
3
][
6
],
\
result1
[
i
][
6
]
+
result1
[
i
+
3
][
6
],
\
round
((
result1
[
i
][
5
]
+
result1
[
i
+
3
][
5
])
/
(
result1
[
i
][
6
]
+
result1
[
i
+
3
][
6
]),
4
)])
round
((
result1
[
i
][
5
]
+
result1
[
i
+
3
][
5
])
/
(
result1
[
i
][
6
]
+
result1
[
i
+
3
][
6
]),
4
)])
if
(
result1
[
i
][
6
]
+
result1
[
i
+
3
][
6
])
!=
0
else
0
#1.3把一天所有的数据存入文件
#1.3把一天所有的数据存入文件
output1
=
OUTPUT_PATH
+
"gray_ffm.csv"
output1
=
OUTPUT_PATH
+
"gray_ffm.csv"
with
open
(
output1
,
'a+'
)
as
f
:
with
open
(
output1
,
'a+'
)
as
f
:
...
@@ -125,14 +125,14 @@ if __name__ == '__main__':
...
@@ -125,14 +125,14 @@ if __name__ == '__main__':
uid_count
=
g_class
.
get_uid_count
()
uid_count
=
g_class
.
get_uid_count
()
uid_clk_times
=
g_class
.
get_uid_clk_times
()
uid_clk_times
=
g_class
.
get_uid_clk_times
()
uid_imp_times
=
g_class
.
get_uid_imp_times
()
uid_imp_times
=
g_class
.
get_uid_imp_times
()
uid_clk_rate
=
round
(
uid_clk_times
/
uid_imp_times
,
4
)
uid_clk_rate
=
round
(
uid_clk_times
/
uid_imp_times
,
4
)
if
uid_imp_times
!=
0
else
0
result2
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
gray
,
uid_count
,
\
result2
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
gray
,
uid_count
,
\
uid_clk_times
,
uid_imp_times
,
uid_clk_rate
])
uid_clk_times
,
uid_imp_times
,
uid_clk_rate
])
result2
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
'all'
,
\
result2
.
append
([
g_class
.
ndays
,
g_class
.
cid_type
,
platform
,
'all'
,
\
result2
[
-
1
][
4
]
+
result2
[
-
2
][
4
],
\
result2
[
-
1
][
4
]
+
result2
[
-
2
][
4
],
\
result2
[
-
1
][
5
]
+
result2
[
-
2
][
5
],
\
result2
[
-
1
][
5
]
+
result2
[
-
2
][
5
],
\
result2
[
-
1
][
6
]
+
result2
[
-
2
][
6
],
\
result2
[
-
1
][
6
]
+
result2
[
-
2
][
6
],
\
round
((
result2
[
-
1
][
5
]
+
result2
[
-
2
][
5
])
/
(
result2
[
-
1
][
6
]
+
result2
[
-
2
][
6
]),
4
)])
round
((
result2
[
-
1
][
5
]
+
result2
[
-
2
][
5
])
/
(
result2
[
-
1
][
6
]
+
result2
[
-
2
][
6
]),
4
)])
if
(
result2
[
-
1
][
6
]
+
result2
[
-
2
][
6
])
!=
0
else
0
#2.2获取所有平台的数据
#2.2获取所有平台的数据
labels
=
[
'gray'
,
'not gray'
,
'all'
]
labels
=
[
'gray'
,
'not gray'
,
'all'
]
for
i
in
range
(
3
):
for
i
in
range
(
3
):
...
@@ -140,7 +140,7 @@ if __name__ == '__main__':
...
@@ -140,7 +140,7 @@ if __name__ == '__main__':
result2
[
i
][
4
]
+
result2
[
i
+
3
][
4
],
\
result2
[
i
][
4
]
+
result2
[
i
+
3
][
4
],
\
result2
[
i
][
5
]
+
result2
[
i
+
3
][
5
],
\
result2
[
i
][
5
]
+
result2
[
i
+
3
][
5
],
\
result2
[
i
][
6
]
+
result2
[
i
+
3
][
6
],
\
result2
[
i
][
6
]
+
result2
[
i
+
3
][
6
],
\
round
((
result2
[
i
][
5
]
+
result2
[
i
+
3
][
5
])
/
(
result2
[
i
][
6
]
+
result2
[
i
+
3
][
6
]),
4
)])
round
((
result2
[
i
][
5
]
+
result2
[
i
+
3
][
5
])
/
(
result2
[
i
][
6
]
+
result2
[
i
+
3
][
6
]),
4
)])
if
(
result2
[
i
][
6
]
+
result2
[
i
+
3
][
6
])
!=
0
else
0
#2.3把一天所有的数据写入文件
#2.3把一天所有的数据写入文件
output2
=
OUTPUT_PATH
+
"gray_all.csv"
output2
=
OUTPUT_PATH
+
"gray_all.csv"
with
open
(
output2
,
'a+'
)
as
f
:
with
open
(
output2
,
'a+'
)
as
f
:
...
@@ -148,7 +148,7 @@ if __name__ == '__main__':
...
@@ -148,7 +148,7 @@ if __name__ == '__main__':
line
=
[
str
(
i
)
for
i
in
line
]
line
=
[
str
(
i
)
for
i
in
line
]
str_line
=
','
.
join
(
line
)
+
'
\n
'
str_line
=
','
.
join
(
line
)
+
'
\n
'
f
.
write
(
str_line
)
f
.
write
(
str_line
)
end
=
time
.
time
()
end
=
time
.
time
()
print
(
"程序执行时间:{}s"
.
format
(
end
-
start
))
print
(
"程序执行时间:{}s"
.
format
(
end
-
start
))
...
...
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