'creates lambda values based upon training data
NOTE: no need to explicitly reference C,
it is contained within the tag variable :: tag == (tag,C)
for each tag trigram (t1, t2, t3)
depending on the maximum value of
- f(t1,t2,t3)-1 / f(t1,t2)-1
- f(t2,t3)-1 / f(t2)-1
- f(t3)-1 / N-1
increment l3,l2, or l1 by f(t1,t2,t3)
ISSUES -- Resolutions:
if 2 values are equal, increment both lambda values
by (f(t1,t2,t3) / 2)'

def _compute_lambda(self):

    tl1 = 0.0
    tl2 = 0.0
    tl3 = 0.0
    for history in self._tri.conditions():
        (h1, h2) = history
        for tag in self._tri[history].keys():
            if (self._uni[tag] == 1):
                continue
            c3 = self._safe_div((self._tri[history][tag] - 1), (self._tri[history].N() - 1))
            c2 = self._safe_div((self._bi[h2][tag] - 1), (self._bi[h2].N() - 1))
            c1 = self._safe_div((self._uni[tag] - 1), (self._uni.N() - 1))
            if ((c1 > c3) and (c1 > c2)):
                tl1 += self._tri[history][tag]
            elif ((c2 > c3) and (c2 > c1)):
                tl2 += self._tri[history][tag]
            elif ((c3 > c2) and (c3 > c1)):
                tl3 += self._tri[history][tag]
            elif ((c3 == c2) and (c3 > c1)):
                tl2 += (self._tri[history][tag] / 2.0)
                tl3 += (self._tri[history][tag] / 2.0)
            elif ((c2 == c1) and (c1 > c3)):
                tl1 += (self._tri[history][tag] / 2.0)
                tl2 += (self._tri[history][tag] / 2.0)
            else:
                pass
    self._l1 = (tl1 / ((tl1 + tl2) + tl3))
    self._l2 = (tl2 / ((tl1 + tl2) + tl3))
    self._l3 = (tl3 / ((tl1 + tl2) + tl3))
