Commit e90294d4 by Jan Wijffels

Docs

parent c5cd949e
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#' @description This function calculates node embeddings in a graph by using #' @description This function calculates node embeddings in a graph by using
#' VERSE (Versatile Graph Embeddings from Similarity Measures) #' VERSE (Versatile Graph Embeddings from Similarity Measures)
#' @param x an object of class dgRMatrix #' @param x an object of class dgRMatrix
#' @param similarity type of similarity. Currently defaults to pagerank.
#' @param dimension integer with the dimension of the embedding #' @param dimension integer with the dimension of the embedding
#' @param epochs number of epochs #' @param epochs number of epochs
#' @param learning_rate the learning rate of the algorithm #' @param learning_rate the learning rate of the algorithm
...@@ -25,7 +26,9 @@ ...@@ -25,7 +26,9 @@
#' x <- as_adj(karate) #' x <- as_adj(karate)
#' x <- as(x, "RsparseMatrix") #' x <- as(x, "RsparseMatrix")
#' #'
#' embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000) #' node_embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000,
#' learning_rate = 0.0025, samples = 3, alpha = 0.85)
#' str(node_embeddings$embeddings)
deepwalker_verse <- function(x, deepwalker_verse <- function(x,
similarity = c("pagerank", "adjacency", "simrank"), similarity = c("pagerank", "adjacency", "simrank"),
dimension = 128, dimension = 128,
...@@ -43,10 +46,9 @@ deepwalker_verse <- function(x, ...@@ -43,10 +46,9 @@ deepwalker_verse <- function(x,
samples = samples, samples = samples,
alpha = alpha) alpha = alpha)
}else if(similarity == "adjacency"){ }else if(similarity == "adjacency"){
.NotYetImplemented()
}else if(similarity == "simrank"){ }else if(similarity == "simrank"){
.NotYetImplemented()
} }
emb emb
} }
\ No newline at end of file
...@@ -11,6 +11,8 @@ deepwalker_verse(x, similarity = c("pagerank", "adjacency", "simrank"), ...@@ -11,6 +11,8 @@ deepwalker_verse(x, similarity = c("pagerank", "adjacency", "simrank"),
\arguments{ \arguments{
\item{x}{an object of class dgRMatrix} \item{x}{an object of class dgRMatrix}
\item{similarity}{type of similarity. Currently defaults to pagerank.}
\item{dimension}{integer with the dimension of the embedding} \item{dimension}{integer with the dimension of the embedding}
\item{epochs}{number of epochs} \item{epochs}{number of epochs}
...@@ -43,5 +45,7 @@ data(karate, package = "igraphdata") ...@@ -43,5 +45,7 @@ data(karate, package = "igraphdata")
x <- as_adj(karate) x <- as_adj(karate)
x <- as(x, "RsparseMatrix") x <- as(x, "RsparseMatrix")
embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000) node_embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000,
learning_rate = 0.0025, samples = 3, alpha = 0.85)
str(node_embeddings$embeddings)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment