Skip to content
This repository
Browse code

grammar

  • Loading branch information...
commit 7c3702e8c2e790d9d29888fb56d49a6109449a1e 1 parent 8b9bbd9
Philipp Wagner authored

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. +6 6 README.markdown
12 README.markdown
Source Rendered
@@ -378,19 +378,19 @@ predicition[1] -- is the generic classifier output, the decision is based on.
378 378
379 379 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:
380 380
381   -```
  381 +```python
382 382 # This gets you the output:
383 383 prediction = model.predict(X)
384 384 predicted_label = prediction[0]
385   -classifier_output = prediction[1]|
  385 +classifier_output = prediction[1]
386 386 # Now let's get the distance from the assuming a 1-Nearest Neighbor.
387   -Since it's a 1-Nearest Neighbor only look take the zero-th element:
  387 +# Since it's a 1-Nearest Neighbor only look take the zero-th element:
388 388 distance = classifier_output['distances'][0]
389 389 # Now you can easily threshold by it:
390 390 if distance > 10.0:
391   -... print "Unknown Person!"
392   -... else
393   -... print "Person is known, with label %i" % (predicted_label)
  391 + print "Unknown Person!"
  392 +else
  393 + print "Person is known with label %i" % (predicted_label)
394 394 ```
395 395
396 396 #### Image processing chains

0 comments on commit 7c3702e

Please sign in to comment.
Something went wrong with that request. Please try again.