kylebgorman/pyclassifiers — pull request #1 by ConstantineLignos (2013-02-14 08:16:56+00:00)
Title: Miss finding in BinaryClassifier.__init__

This addresses two issues in the current version of BinaryClassifier. Consider this setup:
```>>> from binaryclassifier import BinaryClassifier
>>> X = [[1], [2], [3]]
>>> Y1 = [True, True, True]
>>> Y2 = [True, False, True]
```

1. If the response truly is invariant, self.miss is never defined, so checking it in the conditional will crash:
```>>> BinaryClassifier(X, Y1, True)
Traceback (most recent call last):
File "", line 1, in
File "binaryclassifier.py", line 46, in __init__
if not self.miss:
AttributeError: 'BinaryClassifier' object has no attribute 'miss
'```

2. If the miss value evaluates as False in a boolean context, it is if there is no miss value:
```>>> BinaryClassifier(X, Y2, True)
Traceback (most recent call last):
File "", line 1, in
File "binaryclassifier.py", line 47, in __init__
raise ValueError('Outcomes are invariant')
ValueError: Outcomes are invariant
```