mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 18:57:25 +01:00
ranking: Clamp weights to 0.0
This commit is contained in:
parent
21a5817988
commit
7f2847423c
1 changed files with 1 additions and 0 deletions
|
|
@ -67,6 +67,7 @@ optimize_weights <- function(results, methods, reference_gene_ids,
|
||||||
}
|
}
|
||||||
|
|
||||||
factors <- stats::optim(rep(1.0, length(methods)), target_rank)$par
|
factors <- stats::optim(rep(1.0, length(methods)), target_rank)$par
|
||||||
|
factors[factors < 0.0] <- 0.0
|
||||||
total_weight <- sum(factors)
|
total_weight <- sum(factors)
|
||||||
|
|
||||||
weights(factors / total_weight)
|
weights(factors / total_weight)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue