linear :: (Sample a) => TRANSFORM.Transformed a -> Guesswork (Estimated a)
linear (TRANSFORM.Separated train test trace) = do
    let
        trainFeatures = featureMatrix train
        trainTruth    = PV.fromList . map target $ train
        solution      = solve trainFeatures trainTruth 
        estimates     = map (apply solution . features) test
        truths        = map target test
        samples       = test
    return $ Estimated truths estimates samples (trace ++ ",R=linear")
  where
linear :: (Sample a) => TRANSFORM.Transformed a -> Guesswork (Estimated a)
linear (TRANSFORM.Separated train test trace) = do
    let
        trainFeatures = featureMatrix train
        trainTruth    = PV.fromList . map target $ train
        solution      = solve trainFeatures trainTruth 
        estimates     = map (apply solution . features) test
        truths        = map target test
        samples       = test
    return $ Estimated truths estimates samples (trace ++ ",R=linear")
  where
linear (TRANSFORM.Separated train test trace) = do
    let
        trainFeatures = featureMatrix train
        trainTruth    = PV.fromList . map target $ train
        solution      = solve trainFeatures trainTruth 
        estimates     = map (apply solution . features) test
        truths        = map target test
        samples       = test
    return $ Estimated truths estimates samples (trace ++ ",R=linear")
  where