PCA: Print also projection information on the output
[gostyle.git] / data_summarize.sh
blob8d7394ab1099dde83b9e65df2c3435b641ca5c07
1 #!/bin/sh
3 # data_summarize.sh - Summarize raw per-player pattern data by pattern frequency
5 # Usage: data_summarize.sh PLAYERLIST RAWPATDIR PATDIR
7 players=$1; shift
8 rawpatdir=$1; shift
9 patdir=$1; shift
11 summarize() {
12 sort | uniq -c | sort -rn
15 # per-player pattern data
16 cat "$players" | while read player; do
17 echo "$player"
18 cat "$rawpatdir/$player" | summarize >"$patdir/$player"
19 done
21 # summary pattern data
22 echo "all.pat"
23 cat "$players" | while read player; do cat "$rawpatdir/$player"; done |
24 summarize >"$patdir/../all.pat"