logProb = 0
for featureValue in featureVector:
logProb += math.log(self.featureCounts[(label, self.featureNameList[featureVector.index(featureValue)], featureValue)]/self.labelCounts[label])
is better written with a comprehension: logProb = sum(math.log(self.featureCounts[(label, self.featureNameList[featureVector.index(featureValue)], featureValue)]/self.labelCounts[label]) for featureValue in featureVector)
and split into 2 lines.
We create a machine: given a program P, ask O whether P halts given input P and negate the answer.
λP. ~O (P P)
Now we ask whether this machine will halt given its own source code as input. In symbols:
(λP. ~O (P P)) (λP. ~O (P P))
which is the Y-combinator in lambda calculus.