spinner_random_search is a function for fine-tuning using random search on the hyper-parameter space of spinner (predefined or custom).
spinner_random_search(
n_samp,
graph,
target,
node_labels = NA,
edge_labels = NA,
context_labels = NA,
direction = NULL,
sampling = NA,
threshold = 0.01,
method = NULL,
node_embedding_size = NULL,
edge_embedding_size = NULL,
context_embedding_size = NULL,
update_order = NULL,
n_layers = NULL,
skip_shortcut = NULL,
forward_layer = NULL,
forward_activation = NULL,
forward_drop = NULL,
mode = NULL,
optimization = NULL,
epochs = 100,
lr = NULL,
patience = 30,
weight_decay = NULL,
reps = 1,
folds = 2,
holdout = 0.2,
verbose = TRUE,
seed = 42,
keep = FALSE
)This function returns a list including:
random_search: summary of the sampled hyper-parameters and average error metrics.
best: best model according to overall ranking on all average error metrics (for negative metrics, absolute value is considered).
time_log: computation time.
all_models: list with all generated models (if keep flagged to TRUE).
Positive integer. Number of models to be randomly generated sampling the hyper-parameter space.
A graph in igraph format (without name index for nodes).
String. Predicted dimension. Options are: "node", "edge".
String. Character vector with labels of node features. In case of absent features, default to NA (automatic node embedding with selected method).
String. Character vector with labels of edge features. In case of absent features, default to NA (automatic edge embedding with selected method).
String. Character vector with labels of context features. In case of absent features, default to NA (automatic context embedding with selected method).
String. Direction of message propagation. Options are: "from_head", "from_tail". Default to: "from_head".
Positive numeric or integer. In case of huge graph, you can opt for a subgraph. Sampling dimension expressed in absolute value or percentage. Default: NA (no sampling).
Numeric. Below this threshold (calculated on edge density), sampling is done on edges, otherwise on nodes. Default: 0.01.
String. Embedding method in case of absent features. Options are: "null" (zeroed tensor), "laplacian", "adjacency". Default: "null".
Integer. Size for node embedding. Default: 5.
Integer. Size for edge embedding. Default: 5.
Integer. Size for node embedding. Default: 5.
String. The order of message passing through nodes (n), edges (e) and context (c) for updating information. Available options are: "enc", "nec", "cen", "ecn", "nce", "cne". Default: "enc".
Integer. Number of graph net variant layers. Default: 1.
Logical. Flag for applying skip shortcut after the graph net variant layers. Default: FALSE.
Integer. Single integer vector with size for forward net layer. Default: 32 (layers with 32 nodes).
String. Single character vector with activation for forward net layer. Available options are: "linear", "relu", "mish", "leaky_relu", "celu", "elu", "gelu", "selu", "bent", "softmax", "softmin", "softsign", "sigmoid", "tanh". Default: "relu".
Numeric. Single numeric vector with drop out for forward net layer. Default: 0.3.
String. Aggregation method for message passing. Options are: "sum", "mean", "max". Default: "sum".
String. Optimization method. Options are: "adadelta", "adagrad", "rmsprop", "rprop", "sgd", "asgd", "adam".
Positive integer. Default: 100.
Positive numeric. Learning rate. Default: 0.01.
Positive integer. Waiting time (in epochs) before evaluating the overfit performance. Default: 30.
Positive numeric. L2-Regularization weight. Default: 0.001.
Positive integer. Number of repeated measures. Default: 1.
Positive integer. Number of folds for each repetition. Default: 3.
Positive numeric. Percentage of nodes for testing (edges are computed accordingly). Default: 0.2.
Logical. Default: TRUE
Random seed. Default: 42.
Logical. Flag to TRUE to keep all the explored models. Default: FALSE.
Giancarlo Vercellino giancarlo.vercellino@gmail.com
https://rpubs.com/giancarlo_vercellino/spinner