ipfDistance {ipft}R Documentation

Distance function

Description

This function computes the distance from every observation in the test set to every observation in the train test

Usage

ipfDistance(train, test, method = "euclidean", subset = NULL, norm = 2,
  sd = 10, epsilon = 1e-30, alpha = 20, threshold = 20)

Arguments

train

a vector, matrix or data frame containing a set of training examples

test

a vector, matrix or data frame containing a set of test examples

method

The method to be used to calculate the distance. Implemented methods are: 'euclidean', 'manhattan', 'norm', 'LGD' and 'PLGD'

subset

columns to use to compute the distance.

norm

parameter for the 'norm' method

sd

parameter for 'LGD' and 'PLGD' methods

epsilon

parameter for 'LGD' and 'PLGD' methods

alpha

parameter for 'PLGD' method

threshold

parameter for 'PLGD' method

Value

This function returns a matrix with dimensions: nrow(test) x nrow(train), containing the distances from test observations to train observations

Examples

    dist <- ipfDistance(ipftrain[,1:168], ipftest[,1:168])

    dist <- ipfDistance(ipftrain, ipftest, subset = c('X', 'Y'), method = 'manhattan')


[Package ipft version 0.7.2 Index]