Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2012
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import random
  4. import numpy as np
  5. np.set_printoptions(threshold='nan')
  6.  
  7. from shogun.Classifier import *
  8.  
  9. def main():
  10.  
  11. raw_labels = [random.choice([0.0, 1.0]) for r in range(100)]
  12. test_labels = Labels(np.array(raw_labels, dtype=np.double))
  13.  
  14. if __name__ == "__main__":
  15. main()
  16.  
  17. ################################################################################
  18.  
  19. Output:
  20. > python eval.py
  21. Traceback (most recent call last):
  22. File "eval.py", line 24, in <module>
  23. main()
  24. File "eval.py", line 21, in main
  25. test_labels = Labels(np.array(raw_labels, dtype=np.double))
  26. TypeError: Cannot create new instances of type 'Labels'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement