Commit 3aa29644 authored by 赵威's avatar 赵威

add stat count

parent 089c030b
# 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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment