Description Usage Arguments Value Examples
View source: R/generate_input.R
Function generate_input
generates a random list of
nodes from an igraph object.
It also specifies the true solution generating the
list. The graph object needs to have some attributes
(automatically added through generate_graph
)
1 | generate_input(graph, order, length_inputs, return_matrix = TRUE, seed = NULL)
|
graph |
an igraph object, typically from
|
order |
numeric or vector, order of the neighbourhoods that generate the list |
length_inputs |
numeric, number of nodes in the generated inputs |
return_matrix |
logical, should inputs be returned as a matrix? |
seed |
numeric, seed for random number generator |
A list whose elements are lists with three slots:
pos
for the true signal generators, neg
for the
nodes that did not generate signal and input
for the
signal itself
1 2 3 4 5 6 7 8 9 | g <- generate_graph(
fun_gen = igraph::barabasi.game,
param_gen = list(n = 200, m = 3, directed = FALSE),
seed = 1)
synth_input <- generate_input(
g,
order = 2,
length_inputs = 3, return_matrix = TRUE)
str(synth_input)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.