setse_auto_hd: SETSe embedding with automatic drag and timestep selection...

View source: R/setse_auto_hd.R

setse_auto_hdR Documentation

SETSe embedding with automatic drag and timestep selection for high-dimensional feature vectors

Usage

setse_auto_hd(
  g,
  force = "force",
  distance = "distance",
  edge_name = "edge_name",
  k = "k",
  tstep = 0.02,
  mass = 1,
  max_iter = 1e+05,
  tol = 0.002,
  sparse = FALSE,
  hyper_iters = 100,
  hyper_tol = 0.1,
  hyper_max = 30000,
  drag_min = 0.01,
  drag_max = 100,
  tstep_change = 0.2,
  sample = 100,
  static_limit = NULL,
  verbose = FALSE,
  include_edges = TRUE,
  noisy_termination = TRUE
)

Arguments

g

An igraph object

force

A character vector. These are the nodes attributes that contain the force the nodes exert on the network.

distance

A character string. The edge attribute that contains the original/horizontal distance between nodes.

edge_name

A character string. This is the edge attribute that contains the edge_name of the edges.

k

A character string. This is k for the moment don't change it.

tstep

A numeric. The time interval used to iterate through the network dynamics.

mass

A numeric. This is the mass constant of the nodes in normalised networks this is set to 1.

max_iter

An integer. The maximum number of iterations before stopping. Larger networks usually need more iterations.

tol

A numeric. The tolerance factor for early stopping. Setting this value to be 0.1

\item

sparseLogical. Whether or not the function should be run using sparse matrices. must match the actual matrix, this could prob be automated

\item

hyper_itersinteger. The hyper parameter that determines the number of iterations allowed to find an acceptable convergence value.

\item

hyper_tolnumeric. The convergence tolerance when trying to find the minimum value. When the ratio between the current static force and the previous static force is smaller than this value the search terminates. values between 0.1-0.3 seem to be often ok, too small and you waste time fine tuning the parameters instead of converging to big and you have poorly parametrised values.

\item

hyper_maxinteger. The maximum number of iterations that SETSe will go through whilst searching for the minimum.

\item

drag_mininteger. A power of ten. The lowest drag value to be used in the search

\item

drag_maxinteger. A power of ten. if the drag exceeds this value the tstep is reduced

\item

tstep_changenumeric. A value between 0 and 1 that determines how much the time step will be reduced by default value is 0.5

\item

sampleInteger. The dynamics will be stored only if the iteration number is a multiple of the sample. This can greatly reduce the size of the results file for large numbers of iterations. Must be a multiple of the max_iter

\item

static_limitNumeric. The maximum value the static force can reach before the algorithm terminates early. This prevents calculation in a diverging system. The value should be set to some multiple greater than one of the force in the system. If left blank the static limit is the system absolute mean force.

\item

verboseLogical. This value sets whether messages generated during the process are suppressed or not. This is useful for large networks which can take a long time to converge, but for smaller ones can be turned off.

\item

include_edgeslogical. An optional variable on whether to calculate the edge tension and strain. Default is TRUE. included for ease of integration into the bicomponent functions.

\item

noisy_terminationStop the process if the static force does not monotonically decrease.

A list of four elements. A data frame with the height embeddings of the network, a data frame of the edge embeddings, the convergence dynamics dataframe for the network as well as the search history for convergence criteria of the network Uses a grid search and a binary search to find appropriate convergence conditions. This is one of the most commonly used SETSe functions. It automatically selects the convergence time-step and drag values to ensure efficient convergence.

The noisy_termination parameter is used as in some cases the convergence process can get stuck in the noisy zone of SETSe space. To prevent this the process is stopped early if the static force does not monotonically decrease. On large networks this greatly speeds up the search for good parameter values. It increases the chance of successful convergence. More detail on auto-SETSe can be found in the paper "The spring bounces back" (Bourne 2020).

g <- biconnected_network %>% prepare_edges(.) %>% #prepare the continuous features as normal prepare_continuous_force(., node_names = "name", force_var = "force") %>% #prepare the categorical features as normal prepare_categorical_force(., node_names = "name", force_var = "group")

#embed them using the high dimensional function two_dimensional_embeddings <- setse_auto_hd(g, force = c("group_A", "force"), k = "weight")

Other setse: setse_auto(), setse_bicomp(), setse_expanded(), setse() setse


JonnoB/rSETSe documentation built on July 25, 2022, 4:56 p.m.