HasGP-0.1: A Haskell library for inference using Gaussian processes

HasGP.Data.Normalise

Description

Normalise is a module in the HasGP Gaussian process library. It contains functions for performing basic normalisation tasks on training examples, and for computing assorted standard statistics.

Copyright (C) 2011 Sean Holden. sbh11@cl.cam.ac.uk.

Synopsis

Documentation

exampleMean

Arguments

 :: Inputs Matrix - one row per example -> DVector Vector of means for each attribute.

Compute the mean for each attribute in a set of examples.

exampleVariance

Arguments

 :: Inputs Matrix - one row per example -> DVector Vector of variances for each attribute.

Compute the variance for each attribute in a set of examples.

exampleMeanVariance

Arguments

 :: Inputs Matrix - one row per example -> (DVector, DVector) Means and variances

Compute the mean and variance for each attribute in a set of examples.

normaliseMeanVariance

Arguments

 :: DVector Vector of new means required -> DVector Vector of new variances required -> Inputs Matrix - one row per example -> Inputs Normalised matrix

Normalise a set of examples to have specified mean and variance.

normaliseMeanVarianceSimple

Arguments

 :: Double New mean required -> Double New variance required -> Inputs Matrix - one row per example -> Inputs Normalised matrix

The same as normaliseMeanVariance but every column (attribute) is normalised in the same way.

normaliseBetweenLimits

Arguments

 :: Double New min required -> Double New max required -> Inputs Matrix - one row per example -> Inputs Normalised matrix

Normalise a set of examples to have specified maximum and minimum.

findRedundantAttributes

Arguments

 :: Inputs Matrix - one row per example -> [Bool] List - True elements mark redundancy

Find the columns of a matrix in which all values are equal.

listRedundantAttributes

Arguments

 :: Inputs Matrix - one row per example -> [Int] List - positions of redundant attributes

List column numbers for redundant attributes.

removeRedundantAttributes

Arguments

 :: Inputs Matrix - one row per example -> Inputs Modified matrix - one row per example

Remove any redundant columns from a matrix.

retainAttributes

Arguments

 :: [Int] List of columns to keep. -> Inputs Matrix - one row per example -> Inputs Modified matrix - one row per example

Specify a list of columns (matrix numbered from 1). Produce a matrix with ONLY those columns in the order specified in the list.

Compute the numbers for the confusion matrix. It is assumed that classes are +1 (positive) and -1 (negative). Result is (a,b,c,d): a - correct negatives b - predict positive when correct is negative c - predict negative when correct is positive d - correct positives

printConfusionMatrix

Arguments

 :: Targets Vector of targets -> Outputs Vector of actual outputs -> IO ()

Print the confusion matrix and some other statistics

Assuming the labels are +1 or -1, count how many there are of each.