- |'parseFile' parses a space separated file 
-- to a list of lists of Double
parseFile :: String -> ([[Double]], [Double])
parseFile file = ((map fst dataset), (map snd dataset))
  where
    dataset = map parseLine (lines file)
    parseLine l = splitN (doubled l) 
    splitN  l = (1 : (init l), last l) -- add bias +1
    doubled l  = map toDouble (words l)
    toDouble  w = read w :: Double

parseFile :: String -> ([[Double]], [Double])
parseFile file = ((map fst dataset), (map snd dataset))
  where
    dataset = map parseLine (lines file)
    parseLine l = splitN (doubled l) 
    splitN  l = (1 : (init l), last l) -- add bias +1
    doubled l  = map toDouble (words l)
    toDouble  w = read w :: Double
parseFile file = ((map fst dataset), (map snd dataset))
  where
    dataset = map parseLine (lines file)
    parseLine l = splitN (doubled l) 
    splitN  l = (1 : (init l), last l) -- add bias +1
    doubled l  = map toDouble (words l)
    toDouble  w = read w :: Double