Blame view

collaboration/run.sh 1.36 KB
5ab1c29c   tangwang   first commit
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
  #!/bin/bash
  source  ~/.bash_profile
  
  make
  
  DAY=`date -d "1 days ago" +"%Y%m%d"`
  # DAY=20240923
  
  # 清理当前目录下output_开头的 365天以前创建的目录
  find . -type d -name 'output_*' -ctime +365 -exec rm -rf {} \;
  find logs/ -type f -mtime +180 -exec rm -f {} \;
  
  output_dir=output_${DAY}
  mkdir ${output_dir}
  
  
  # cat ../fetch_data/data/session.txt.${DAY}  | bin/swing   0.7 1 3 4 ${output_dir} 1
  cat ../fetch_data/data/session.txt.all  | cut -f 2 | bin/swing   0.7 1 3 4 ${output_dir} 1
  
  # cat ./data/${DAY}/*  | bin/swing_symmetric 0.8 1.0 0
  # cat ./data/${DAY}/*  | bin/swing_1st_order 0.1 0.5 1 1 
  
  # 检查命令是否成功执行
  if [[ $? -eq 0 ]]; then
      # 如果成功执行,删除已有的软链接或文件,并创建新的软链接
      if [[ -e output ]]; then
          rm -rf output
      fi
      ln -s "${output_dir}" output
      echo "命令执行成功,软链接已更新为指向 ${output_dir}"
  else
      echo "命令执行失败,未更新软链接"
  fi
  
  # 对结果进行合并
  cat output/sim_matrx.* > output/swing_similar.txt
  
  
  # 用户协同
  # 仅使用最新的10万条数据,降低历史数据的影响,使得给每个user推荐的结果随着最新数据动态变化
  # 2024-10-10 最近几个月平均每天1000,5万大概为50天
  tail -n 50000  ../fetch_data/data/session.txt.all > output/ucf.input
  python3 src/ucf.py output/ucf.input output/ucf.txt