Description Usage Arguments Value Examples
View source: R/tuneThreshold.R
Performs a search over possible cutoff thresholds ε. All edges with an importance score below ε are removed and the random forests are retrained without those connections.
1 | tuneThreshold(data, ugene, cutoffs = NULL, showPareto = TRUE)
|
data |
Required. Same data as provided to inferNetwork(). |
ugene |
Required. Output of the inferNetwork() function. |
cutoffs |
Optional. When not provided, edges are removed in two ways. Both cases start with a sparse network, one that has at least one connection/edge per column of the network matrix. This ensures that for each node, at least one node is used as input to the model.
If provided, the cutoffs should be a vector of double numerics between 0 and 1 exclusive. For each cutoff, all connections in the learned network with values below the cutoff will be masked. If the result of the mask happens to remove an entire column of the network matrix, there will be an error. |
showPareto |
Optional. If TRUE (default), shows a plot of the mean squared residual error of the fitted random forests for all nodes, versus the complexity of the network. The ideal network complexity should be the smallest number of connections at which the error drops steeply (known as an Pareto front). |
An object of class "ugene.analysis" that contains the following:
stepErrors - a vector of numerics, the average mean squared error of the random forests used for prediction, in the order of sparsest to more complex networks.
colErrors - a vector of numerics, same as stepErrors but constructed with the masks described above as column-wise.
stepMasks - a list of matrices, the masks constructed by the step-wise method.
colMasks - a list of matrices, the masks constructed by the column-wise method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# Automatic threshold tuning
ugene <- inferNetwork(Repressilator, mtry = 3L)
result <- tuneThreshold(Repressilator, ugene)
# take a look at network corresponding to the third and seventh
# step-wise mask (both has drops in mse)
inferNetwork(Repressilator, mask = result$stepMasks[[3]], showPlot = TRUE)
inferNetwork(Repressilator, mask = result$stepMasks[[7]], showPlot = TRUE)
# Custom threshold tuning
ugene <- inferNetwork(Repressilator, mtry = 3L)
result <- tuneThreshold(Repressilator, ugene,
cutoffs=seq(from = 0.1, to = 0.5, by = 0.05))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.