ranking: Clamp weights to 0.0

This commit is contained in:
Elias Projahn 2021-10-21 16:21:55 +02:00
parent 21a5817988
commit 7f2847423c

View file

@ -67,6 +67,7 @@ optimize_weights <- function(results, methods, reference_gene_ids,
}
factors <- stats::optim(rep(1.0, length(methods)), target_rank)$par
factors[factors < 0.0] <- 0.0
total_weight <- sum(factors)
weights(factors / total_weight)