Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
strategy_embedding
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
rank
strategy_embedding
Commits
3aa29644
Commit
3aa29644
authored
Oct 29, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add stat count
parent
089c030b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
tests.py
word_vector/tests.py
+26
-1
No files found.
word_vector/tests.py
View file @
3aa29644
# from django.test import TestCase
import
os
# create your tests here.
# /opt/spark/bin/spark-submit --master yarn --deploy-mode client --queue root.strategy --driver-memory 16g --executor-memory 1g --executor-cores 1 --num-executors 70 --conf spark.default.parallelism=100 --conf spark.storage.memoryFraction=0.5 --conf spark.shuffle.memoryFraction=0.3 --conf spark.locality.wait=0 --jars /srv/apps/tispark-core-2.1-SNAPSHOT-jar-with-dependencies.jar,/srv/apps/spark-connector_2.11-1.9.0-rc2.jar,/srv/apps/mysql-connector-java-5.1.38.jar /srv/apps/strategy_embedding/word_vector/tests.py
base_dir
=
os
.
getcwd
()
print
(
"base_dir: "
+
base_dir
)
model_dir
=
os
.
path
.
join
(
base_dir
,
"_models"
)
data_dir
=
os
.
path
.
join
(
base_dir
,
"_data"
)
if
__name__
==
"__main__"
:
id1
=
[
"366825"
,
"203194"
]
# 下颚角
id2
=
[
"87874"
,
"84198"
]
# 双眼皮
with
open
(
os
.
path
.
join
(
data_dir
,
"click_tractate_ids.csv"
),
"r"
)
as
f
:
data
=
f
.
readlines
()
count
=
0
id1_count
=
0
id2_count
=
0
for
i
in
data
:
count
+=
1
tmp
=
i
.
split
(
"|"
)
device_id
=
tmp
[
0
]
ids
=
tmp
[
1
]
.
rstrip
(
"
\n
"
)
.
split
(
","
)
if
id1
[
0
]
in
ids
and
id1
[
1
]
in
ids
:
id1_count
+=
1
if
id2
[
0
]
in
ids
and
id2
[
i
]
in
ids
:
id2_count
+=
1
print
(
count
,
id1_count
,
id2_count
)
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