Advertisement
Guest User

Untitled

a guest
Jul 8th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.48 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # We have to set up the script then go.
  4. train=$1;
  5. test=$2;
  6. labels=$3;
  7.  
  8. cat > test_file.sg << EOF
  9. % Straight outta examples/cmdline/classifier_knn.sg.
  10. print KNN
  11.  
  12. set_distance EUCLIDEAN REAL
  13. set_features TRAIN $train
  14. set_labels TRAIN $labels
  15.  
  16. new_classifier KNN
  17. train_classifier 4
  18.  
  19. set_features TEST $test
  20. out.txt = classify
  21. EOF
  22.  
  23. # Now run it and time it.
  24. export LD_LIBRARY_PATH=shogun
  25. time interfaces/cmdline_static/shogun test_file.sg
  26.  
  27. #rm test_file.sg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement