diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/hinduce-classifier.cabal b/hinduce-classifier.cabal
new file mode 100644
--- /dev/null
+++ b/hinduce-classifier.cabal
@@ -0,0 +1,22 @@
+Name:           hinduce-classifier
+Version:        0.0.0.0
+License:        BSD3
+Author:         Robert Hensing
+Maintainer:     hackage@roberthensing.nl
+Synopsis:       Interface and utilities for classifiers
+Description:    Provides an interface for classifiers and functions to use and analyze them. Take one or more hinduce-classifier-* packages for actual classifier implementations.
+Stability:      stable
+Maintainer:     Robert Hensing
+Build-Type:     Simple
+Cabal-Version:  >= 1.2
+Category:       Data Mining
+
+Library
+    Build-Depends:      haskell98
+                        , base >= 4 && < 5
+                        , layout >= 0.0.0.1
+                        , hinduce-missingh >= 0.0.0.0
+    Exposed-Modules:    Data.HInduce.Classifier
+                        Data.HInduce.Classifier.Class
+    Hs-Source-Dirs:     src
+    Extensions:	        MultiParamTypeClasses, FunctionalDependencies
diff --git a/src/Data/HInduce/Classifier.hs b/src/Data/HInduce/Classifier.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/HInduce/Classifier.hs
@@ -0,0 +1,63 @@
+-- | In machine learning and pattern recognition, classification
+-- refers to an algorithmic procedure for assigning a given piece of
+-- input data into one of a given number of categories. An example
+-- would be assigning a given email into “spam” or “non-spam” classes
+-- or assigning a diagnosis to a given patient as described by
+-- observed characteristics of the patient (gender, blood pressure,
+-- presence or absence of certain symptoms, etc.). An algorithm that
+-- implements classification, especially in a concrete implementation,
+-- is known as a classifier. The term “classifier” sometimes also
+-- refers to the mathematical function, implemented by a
+-- classification algorithm, that maps input data to a category.
+-- (<https://en.wikipedia.org/wiki/Classification_in_machine_learning>,
+-- Nov 28 2011)
+
+module Data.HInduce.Classifier
+       ( module Data.HInduce.Classifier.Class
+       , confusion, confusion'
+       , absConfusion, absConfusion'
+       ) where
+import Control.Arrow
+import Data.HInduce.Classifier.Class
+import Data.List.HIUtils
+import Text.Layout
+import Ratio
+
+-- | A confusion matrix, represented sparsely as an association list.
+--
+-- Keys are (realLabel, classificationLabel) :: (label, label)
+newtype Confusion label = Confusion { fromConfusion :: [((label, label), Int)] }
+        deriving (Eq, Ord, Read, Show)
+
+-- | Calculate the confusion matrix of a classifier. Prefer @confusion'@ in ghci.
+confusion  :: (Classifier classifier attributes label,
+               Ord label,
+               Fractional f) =>
+              classifier -> [(attributes, label)] -> [((label, label), f)]
+confusion cl db = map (second (fromRational . (% s) . fromIntegral)) absconf
+  where absconf = absConfusion cl db
+        s = fromIntegral . sum . map snd $ absconf
+
+-- | Calculate the confusion matrix of a classifier, showing numbers of occurance instead of relative frequencies. Prefer @absConfusion'@ in ghci.
+absConfusion :: ( Classifier classifier attributes label
+                , Ord label
+                ) =>
+        classifier -> [(attributes, label)] -> [((label, label), Int)]
+absConfusion cl = count . aggregate . toLabelpairs
+  where toLabelpairs = map (snd &&& classify cl . fst)
+        count = map (head &&& length)
+
+-- | Like @confusion@, but puts it in a nice table.
+confusion' :: ( Classifier classifier attributes label
+                , Ord label, Show label
+                ) =>
+                classifier -> [(attributes, label)] -> Table label label Double
+confusion' cl db = Table "Confusion Matrix" ("Actual", "Predicted") $ confusion cl db
+
+
+-- | Like @absConfusion@, but puts it in a nice table.
+absConfusion' :: ( Classifier classifier attributes label
+                , Ord label, Show label
+                ) =>
+                classifier -> [(attributes, label)] -> Table label label Int
+absConfusion' cl db = Table "Absolute Confusion Matrix" ("Actual","Predicted") $ absConfusion cl db
diff --git a/src/Data/HInduce/Classifier/Class.hs b/src/Data/HInduce/Classifier/Class.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/HInduce/Classifier/Class.hs
@@ -0,0 +1,6 @@
+module Data.HInduce.Classifier.Class
+       where
+
+class Classifier classifier attributes label 
+                       | classifier -> attributes label where
+  classify :: classifier -> attributes -> label
