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

exampleMeanSource

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.

exampleVarianceSource

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.

exampleMeanVarianceSource

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.

normaliseMeanVarianceSource

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.

normaliseMeanVarianceSimpleSource

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.

normaliseBetweenLimitsSource

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.

findRedundantAttributesSource

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.

listRedundantAttributesSource

Arguments

:: Inputs

Matrix - one row per example

-> [Int]

List - positions of redundant attributes

List column numbers for redundant attributes.

removeRedundantAttributesSource

Arguments

:: Inputs

Matrix - one row per example

-> Inputs

Modified matrix - one row per example

Remove any redundant columns from a matrix.

retainAttributesSource

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.

confusionMatrix :: Targets -> Outputs -> (Double, Double, Double, Double)Source

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

printConfusionMatrixSource

Arguments

:: Targets

Vector of targets

-> Outputs

Vector of actual outputs

-> IO () 

Print the confusion matrix and some other statistics

countLabels :: Targets -> IO ()Source

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