npdrDistances: npdrDistances

View source: R/nearestNeighbors.R

npdrDistancesR Documentation

npdrDistances

Description

Create m x m distance matrix from m instances and p attributes using different metrics. Used by nearestNeighbors(). Note: Probably best to standardize data before manhattan and euclidean.

Usage

npdrDistances(attr.mat, metric = "manhattan", fast.dist = FALSE)

Arguments

attr.mat

m x p matrix of m instances and p attributes

metric

for distance matrix between instances (default: "manhattan", others include "euclidean", versions scaled by max-min, "relief-scaled-manhattan" and "relief-scaled-euclidean", and for GWAS "allele-sharing-manhattan").

fast.dist

whether or not distance is computed by faster algorithm in wordspace, default as F

Value

matrix of m x m (instances x intances) pairwise distances.

Examples

train_dat <- case.control.3sets$train
dist.mat <- npdrDistances(
  train_dat[, names(train_dat) != "class"],
  metric = "manhattan"
)

insilico/glmSTIR documentation built on July 7, 2023, 12:29 a.m.