This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
code:demo2d [2015/09/28 14:40] asa |
code:demo2d [2015/09/28 14:44] asa |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Displaying the decision boundary of a classifier | + | ===== Displaying the decision boundary of a classifier ===== |
- | ================================================= | + | |
+ | Below is Python code for displaying the decision boundary of a classifier. | ||
+ | |||
+ | To use it: | ||
+ | |||
+ | (:source lang=Python:) | ||
+ | |||
+ | import demo2d | ||
+ | from sklearn import svm | ||
+ | |||
+ | demo2d.get_data() | ||
+ | |||
+ | classifier = svm.LinearSVC() | ||
+ | |||
+ | demo2d.decision_surface(classifier) | ||
+ | |||
+ | (:sourceend:) | ||
<file python demo2d.py> | <file python demo2d.py> |