mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 19:27:24 +01:00
Generalize method definitions
This commit is contained in:
parent
d3edeefbe2
commit
9b0b3c13f5
7 changed files with 137 additions and 169 deletions
6
neural.R
6
neural.R
|
|
@ -6,7 +6,7 @@ library(neuralnet)
|
|||
#' The result will be a data.table with the following columns:
|
||||
#'
|
||||
#' - `gene` Gene ID of the processed gene.
|
||||
#' - `neural` Output score given by the neural network.
|
||||
#' - `score` Output score given by the neural network.
|
||||
#'
|
||||
#' @param distances Distance data to use.
|
||||
#' @param species_ids Species, whose data should be included.
|
||||
|
|
@ -105,6 +105,6 @@ process_neural <- function(distances, species_ids, gene_ids,
|
|||
|
||||
# Return the resulting scores given by applying the neural network.
|
||||
|
||||
data[, neural := compute(nn, data)$net.result]
|
||||
data[, .(gene, neural)]
|
||||
data[, score := compute(nn, data)$net.result]
|
||||
data[, .(gene, score)]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue