linear (TRANSFORM.LeaveOneOut samples trace) = do
    let
        indices    = [0..(length samples - 1)]
        groups     = map (takeBut samples) indices
        solutions  = map (second trainLinear') groups
        truths     = map target samples
        estimates  = map (uncurry apply . second features . flip') solutions
    return $ Estimated truths estimates samples (trace ++ ",R=linear")
  where
    flip' (a,b) = (b,a)

linear (TRANSFORM.LeaveOneOut samples trace) = do
    let
        indices    = [0..(length samples - 1)]
        groups     = map (takeBut samples) indices
        solutions  = map (second trainLinear') groups
        truths     = map target samples
        estimates  = map (uncurry apply . second features . flip') solutions
    return $ Estimated truths estimates samples (trace ++ ",R=linear")
  where
    flip' (a,b) = (b,a)
linear (TRANSFORM.LeaveOneOut samples trace) = do
    let
        indices    = [0..(length samples - 1)]
        groups     = map (takeBut samples) indices
        solutions  = map (second trainLinear') groups
        truths     = map target samples
        estimates  = map (uncurry apply . second features . flip') solutions
    return $ Estimated truths estimates samples (trace ++ ",R=linear")
  where
    flip' (a,b) = (b,a)