Permalink
Browse files

grammar

  • Loading branch information...
1 parent 8b9bbd9 commit 7c3702e8c2e790d9d29888fb56d49a6109449a1e @bytefish committed Jan 5, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 README.markdown
View
12 README.markdown
@@ -378,19 +378,19 @@ predicition[1] -- is the generic classifier output, the decision is based on.
Now let's say you have estimated, that every distance above `10.1` is nonsense and should be ignored. Then you could do something like this in your script, to threshold against the given value:
-```
+```python
# This gets you the output:
prediction = model.predict(X)
predicted_label = prediction[0]
-classifier_output = prediction[1]|
+classifier_output = prediction[1]
# Now let's get the distance from the assuming a 1-Nearest Neighbor.
-Since it's a 1-Nearest Neighbor only look take the zero-th element:
+# Since it's a 1-Nearest Neighbor only look take the zero-th element:
distance = classifier_output['distances'][0]
# Now you can easily threshold by it:
if distance > 10.0:
-... print "Unknown Person!"
-... else
-... print "Person is known, with label %i" % (predicted_label)
+ print "Unknown Person!"
+else
+ print "Person is known with label %i" % (predicted_label)
```
#### Image processing chains

0 comments on commit 7c3702e

Please sign in to comment.