Warning: Declaration of action_plugin_tablewidth::register(&$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /s/bach/b/class/cs545/public_html/fall16/lib/plugins/tablewidth/action.php on line 93
code:demo2d [CS545 fall 2016]

User Tools

Site Tools


code:demo2d

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
code:demo2d [2015/09/28 14:46]
asa
code:demo2d [2016/09/29 14:35]
asa
Line 6: Line 6:
 To use it: To use it:
  
-(:source lang=python:) +<​file ​python ​using_demo2d.py>​
  
 import demo2d import demo2d
Line 17: Line 17:
 demo2d.decision_surface(classifier) demo2d.decision_surface(classifier)
  
-(:​sourcend:​) +</​file>​
  
 <file python demo2d.py>​ <file python demo2d.py>​
Line 61: Line 60:
     if event.key == '​q'​ :     if event.key == '​q'​ :
         if len(X) == 0 : return         if len(X) == 0 : return
-        print 'done creating data.  close this window and use the decisionSurface function'​+        print ('done creating data.  close this window and use the decisionSurface function'​)
         pylab.disconnect(binding_id)         pylab.disconnect(binding_id)
     if event.key =='​1'​ or event.key == '​2'​ :     if event.key =='​1'​ or event.key == '​2'​ :
         if event.inaxes is not None:         if event.inaxes is not None:
-            print 'data coords',​ event.xdata,​ event.ydata+            print ('data coords',​ event.xdata,​ event.ydata)
             X.append([event.xdata,​ event.ydata])             X.append([event.xdata,​ event.ydata])
             Y.append(key_to_class[event.key])             Y.append(key_to_class[event.key])
code/demo2d.txt · Last modified: 2016/09/29 14:35 by asa