ipft (version 0.2.2)

ipfDist: Distance function

Description

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

Usage

ipfDist(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

Run this code
    dist <- ipfDist(ipftrain[,1:168], ipftest[,1:168])

    dist <- ipfDist(ipftrain, ipftest, subset = seq(1,168))

    dist <- ipfDist(ipftrain, ipftest, subset = c('LONGITUDE', 'LATITUDE'), method = 'manhattan')

Run the code above in your browser using DataLab