datasets-0.1.0.1: Classical data sets for statistics and machine learning

Safe HaskellNone
LanguageHaskell98

Numeric.Datasets

Contents

Synopsis

Using datasets

getDataset :: Dataset a -> IO [a] Source #

Load a dataset, using the system temporary directory as a cache

type Dataset a Source #

Arguments

 = FilePath

Directory for caching downloaded datasets

-> IO [a] 

A dataset is defined as a function from the caching directory to the IO action that loads the data

Defining datasets

csvDatasetPreprocess :: FromRecord a => (ByteString -> ByteString) -> Source -> Dataset a Source #

Define a dataset from a pre-processing function and a source for a CSV file

csvDataset :: FromRecord a => Source -> Dataset a Source #

Define a dataset from a source for a CSV file

Helper functions for parsing

dashToCamelCase :: String -> String Source #

Turn dashes to CamlCase

parseDashToCamelField :: Read a => Field -> Parser a Source #

Parse a field, first turning dashes to CamlCase

parseReadField :: Read a => Field -> Parser a Source #

parse somethign, based on its read instance

dropLines :: Int -> ByteString -> ByteString Source #

Drop lines from a bytestring

fixAmericanDecimals :: ByteString -> ByteString Source #

Turn US-style decimals starting with a period (e.g. .2) into something Haskell can parse (e.g. 0.2)