github.com/pachyderm/pachyderm@v1.13.4/examples/ml/hyperparameter/select.json (about) 1 { 2 "pipeline": { 3 "name": "select" 4 }, 5 "description": "A pipeline that selects the best evaluation metrics from the results of the `test` pipeline.", 6 "transform": { 7 "image": "dianoga/docker-ubuntu-jq-curl-bc", 8 "cmd": [ "/bin/bash" ], 9 "stdin": [ 10 "bestmetric=0.0", 11 "for f in /pfs/test/*", 12 "do", 13 "metric=`cat $f`", 14 "if [ `echo $metric'>='$bestmetric | bc -l` -eq 1 ]", 15 "then", 16 "bestmetric=$metric", 17 "fi", 18 "done", 19 "for model in /pfs/model/*", 20 "do", 21 "modelfile=$(basename \"$model\")", 22 "modelfile=${modelfile::-4}", 23 "metricfile=\"_metric.txt\"", 24 "metricfile=$modelfile$metricfile", 25 "metric=`cat /pfs/test/$metricfile`", 26 "if [ $metric == $bestmetric ]", 27 "then", 28 "ln -s $model /pfs/out/$modelfile.pkl", 29 "fi", 30 "done" 31 ] 32 }, 33 "parallelism_spec": { 34 "constant": "1" 35 }, 36 "input": { 37 "cross": [ 38 { 39 "pfs": { 40 "repo": "test", 41 "glob": "/" 42 } 43 }, 44 { 45 "pfs": { 46 "repo": "model", 47 "glob": "/" 48 } 49 } 50 ] 51 } 52 }