DimSqueezer: Class '"DimSqueezer"'

Description Extends Warning Fields Methods Author(s) References See Also Examples

Description

Provides a reference class that implements the self-organising-deltoids (SOD) multi-dimensional-scaling algorithm (MDS) using openMP to provide parallel execution on multiple CPU cores.
New objects are made by calling the initializer using either DimSqueezer$new(m) or new("DimSqueezer", m).
The initializer returns an object from which the methods and fields can be accessed using the $ operator. See the examples section for usage.

Extends

All reference classes extend and inherit methods from "envRefClass".

Warning

Fields

pointer:

Object of class externalptr that refers to the C++ DimSqueezer object (read only).

data.matrix:

Object of class matrix a numeric matrix used to create the DimSqueezer.

Methods

initialize(m):

Initializes the object. m should be a numeric matrix (use by calling new as in examples).

squeeze(target_dim, iter_no):

Squeezes points into target_dim dimensions in iter_no iterations. By default the function will continue iterating until no more stress is removed. This can be changed by residual(FALSE). Returns a named list of class sod_sq3 containing the new coordinates in $pos, the stress evolution in $stress, the mapping dimensionality in $mapDims and the stress (sum error) at each node in $node_stress.

squeezeDF(dimFactors):

Squeezes points using a reduction in dimensions as specifed by the numeric matrix dimFactors, which can be obtained from the *DimFactors functions. Returns a named list as for squeeze.

useOpenMP(useOMP):

Specify whether to use openMP based parallelisation. useOMP should be either TRUE or FALSE.

setThreadNo(threadNo):

Specify the number of threads that will be used with openMP. If threadNo is smaller than 1 or larger than the reported number of processor cores it will default to the number of cores available.

residual(remResidual):

Specify whether residual stress should be removed by further iterations after the specified number of iterations (the default state). remResidual should be TRUE or FALSE.

Author(s)

Martin Jakt

References

http://martin.jakt.org.uk/r-sod/

See Also

DimSqueezer_CL
serialDimFactors
parallelDimFactors
parallelExpDimFactors
sod_sq3

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
showClass("DimSqueezer")
## get the attached data f186
data(f186)
## columns 7:12 contain data of the same type
## see the documentation for f186
m <- as.matrix(f186[,7:12])

## reduce the number of objects to speed up automated
## checks.
r <- 1:100
ds <- new("DimSqueezer", m[r,])
## equivalent to
## ds <- DimSqueezer$new( m[r,] )

## to inspect the data matrix
summary(ds$data.matrix)

## For CRAN automated checks set the number of threads to use to
## two
ds$setThreadNo(2)

## squeeze our the superfluous dimensions using 200 iterations
sq <- ds$squeeze(2, 200)

plotPoints(sq)
## with more informative colours
plotPoints(sq, col=hsvScale(f186[,"Etv2"]), pch=19, cex=1.5)

## or for a fancy plot
plotConcentric(sq, cex.data=f186[r,7:12], leg.pos="topleft")

## to see the stress evolution
plotStress(sq)

SOD documentation built on May 30, 2017, 2:03 a.m.