ipfDistance: Distance function

Description Usage Arguments Value Examples

Description

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

Usage

1
2
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

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

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

ipft documentation built on May 2, 2019, 7:23 a.m.

Related to ipfDistance in ipft...