do.optimFreeviz: Optimize the Dimensional Anchors Position using the Freeviz...

View source: R/do.optimFreeviz.R

do.optimFreevizR Documentation

Optimize the Dimensional Anchors Position using the Freeviz algorithm

Description

Allows to compute the best arrangement of Dimensional Anchors so that visualization efficiency (i.e. separation between classes) is maximized. The Freeviz algorithm is implemented in C++ for optimal computational efficiency.

Usage

do.optimFreeviz(
  x,
  classes,
  attractG = 1,
  repelG = 1,
  law = 0,
  steps = 10,
  springs = NULL,
  multilevel = FALSE,
  nClusters = 5000,
  minTreeLevels = 3,
  subsetting = FALSE,
  minSamples = 1000,
  print = TRUE
)

Arguments

x

Dataframe or matrix, with observations as rows and attributes as columns

classes

Vector with class labels of the observations

attractG

Number specifying the weight of the attractive forces

repelG

Number specifying the weight of the repulsive forces

law

Integer, specifying how forces change with distance: 0 = (inverse) linear, 1 = (inverse) square

steps

Number of iterations of the algorithm before re-considering convergence criterion

springs

Numeric matrix with initial anchor coordinates. When NULL (=default), springs are initialized by make.S

multilevel

Logical, indicating whether multi-level computation should be used. Setting it to TRUE can speed up computations

nClusters

Number of clusters to be used at coarsest level of hierarchical tree (only used when multilevel is set to TRUE)

minTreeLevels

Minimum number of clustering levels to consider (only used when multilevel is set to TRUE). This parameter might over-rule nClusters .

subsetting

Logical, indicating whether a subsetting procedure should be used to compute the springs. The subset size is iteratively increased until the springs are found to be close enough to their true values, based on a confidence interval. For large datasets this option can considerably speed up computations.

minSamples

Minimum number of samples to be considered for subsetting (only used when subsetting is set to TRUE)

print

Logical, indicating whether information on the iterative procedure should be printed in the R console

Details

Freeviz is an optimization method that finds the linear projection that best separates instances of different classes, based on a physical metaphor. Observations are considered as physical particles, that exert forces onto each other. Attractive forces occur between observations of the same class, and repulsive forces between observations of different classes, with the force strength depending on the distance between observations. The goal of Freeviz is to find the projection with minimal potential energy. For more details, see the original Freeviz paper: doi: 10.1016/j.jbi.2007.03.010

Value

A matrix with 2 columns (x and y coordinates of dimensional anchors) and 1 line per dimensional anchor (so called springs).

Author(s)

Nicolas Sauwen

Examples

data(iris)
das <- c('Sepal.Length','Sepal.Width','Petal.Length','Petal.Width')
S <- make.S(das)
rv <- do.radviz(iris,S)
plot(rv,anchors.only=FALSE)
new.S <- do.optimFreeviz(x = iris[,das], classes = iris$Species)
new.rv <- do.radviz(iris,new.S)
plot(new.rv,anchors.only=FALSE)


yannabraham/Radviz documentation built on April 3, 2022, 1:30 p.m.