dr_measure: A measure of kNN of original and dimension reduced data

Description Usage Arguments Details Examples

View source: R/dr_measure.R

Description

The idea is to measure the effectiveness of dimension reduction methods by computing a measure using the nearest neighbors of a point in the original space and the reduced space. Currently, "jaccard" is implemented.

Usage

1
dr_measure(ldData, d, measure = "jaccard", ...)

Arguments

ldData

(numeric matrix) Dimension reduced data

d

('dist' object) Distances between points in the original space

measure

Currently, "jaccard" is implemented

...

Additional arguments to be passed to kNN

Details

The metric used to compute distances on dimension reduced data is always euclidean.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
d_full  <- stats::dist(iris[,1:4])
newData <- stats::cmdscale(d_full)
newData_tsne <- Rtsne::Rtsne(d_full, is_distance = TRUE)[["Y"]]

vec <- dr_measure(newData, d_full, k = 10)
summary(vec)
plot(stats::density(vec))

vec_tsne <- dr_measure(newData_tsne, d_full, k = 10)
summary(vec_tsne)
plot(stats::density(vec_tsne))

talegari/sidekicks documentation built on Sept. 26, 2018, 4:18 p.m.