Coder Social home page Coder Social logo

jonnob / rsetse Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 9.22 MB

This package is used to calculate the Strain Elevation Tension Spring embedding (SETSe) for networks in R

Home Page: https://jonnob.github.io/rSETSe/

License: GNU General Public License v3.0

R 87.64% C++ 12.36%
embedding-graphs networkscience embedding networks r unsupervised-learning igraph graph-embedding

rsetse's Introduction

rSETSe

CRAN status R build status Travis build status

Importnant note

The github version of R setse has been updated so that setse_auto_hd has been re-written in c++ using Rcpp Armadillo. This makes it much faster (between 36 -350 times) than the version on CRAN. If you have larger networks I would definately advise using installing from github not CRAN.

An R package for embedding graphs using the SETSe algorithm

This is the R package for the Strain Elevation Tension Spring embeddings (SETSe) algorithm. SETSe is a deterministic graph embeddings algorithm. It converts the node attributes of a graph into forces and the edge attributes into springs. The algorithm finds an equilibrium position when the forces of the nodes are balanced by the forces on the springs. A full description of the algorithm is given in "The spring bounces back: Introduction to Strain Elevation Tension Spring embedding for network representation" (Bourne 2020). There is a website for the package providing documentation and vignettes at https://jonnob.github.io/rSETSe/index.html . This is a very niche package so please feel free to reach out to me on twitter or through email with questions.

Installation instructions

The package is available on CRAN and can be installed by running install.packages("rsetse").Alternatively it can be installed from github using the below method.

  1. Open R/Rstudio and ensure that devtools has been installed
  2. Run the following code library(devtools); install_github("JonnoB/rSETSe")
  3. Load the package normally using library(rsetse)
  4. All functions have help files e.g ?setse_auto

The package can also be downloaded or cloned then installed locally using the install function from devtools.

Basic use

library(rSETSe)

#prepares a graph for embedding using SETSe
set.seed(234) #set the random see for generating the network
g <- generate_peels_network(type = "E") %>%
prepare_edges(k = 500, distance = 1) %>%
#prepare the network for a binary embedding
prepare_categorical_force(., node_names = "name",
                     force_var = "class") 
                       
#Embedds using the bi-connected auto-parametrization algorithm.
#This method is strongly reccomended, it tends to be much faster and almost always converges
embeddings <- setse_bicomp(g,
                           force = "class_A",
                           tol = sum(abs(vertex_attr(g, "class_A")))/1000,
                           hyper_tol = 0.1,
                           hyper_iters = 3000,
                           verbose = T)

Cite

To cite rsetse in publications use: Bourne, J. The spring bounces back: introducing the strain elevation tension spring embedding algorithm for network representation. Appl Netw Sci 5, 88 (2020). https://doi.org/10.1007/s41109-020-00329-4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.