perf {diffuStats} | R Documentation

## Compare diffusions to a target score on a grid of parameters

### Description

Function `perf` computes diffusion scores on a grid of parameters and evaluates them using the gold standard scores provided by the user.

### Usage

    perf(scores, validation, grid_param, metric = list(auc = metric_fun(curve =
        "ROC")), ...)

### Arguments

`scores` | scores to be smoothed; either a named numeric vector, a column-wise matrix whose rownames are nodes and colnames are different scores, or a named list of such matrices.
`validation` | target scores to which the smoothed scores will be compared to. Must have the same format as the input scores, although the number of rows may vary and only the matching rows will give a performance measure
`grid_param` | data frame containing parameter combinations to explore. The column names should be the names of the parameters.
`metric` | named list of metrics to apply. Each metric should accept the form `f(actual, predicted)`
`...` | additional named arguments for the diffusion method. It's important to input at least an `igraph` object or, alternative, a kernel matrix `K`

### Details

Function `perf` takes a network in igraph format, an initial state to score all the nodes in the network, a target score set. To explore the parameter combinations, it needs a grid and a list of metrics to apply. The validation scores might be only a subset of the network nodes, in which case the metric will be restricted to this set as well.

### Value

A data frame containing the performance of each diffusion score

### Examples

    # Using a single vector of scores
    data(graph_toy)
    df_perf <- perf(
        graph = graph_toy,
        scores = graph_toy$input_vec,
        validation = graph_toy$input_vec,
        grid_param = expand.grid(method = c("raw", "ml")))
    df_perf
    # Using a matrix with four set of scores
    # called Single, Row, Small_sample, Large_sample
    df_perf <- perf(
        graph = graph_toy,
        scores = graph_toy$input_mat,
        validation = graph_toy$input_mat,
        grid_param = expand.grid(method = c("raw", "ml")))
    df_perf

[Package diffuStats version 1.7.0 Index]