Skip to content

Commit

Permalink
fix a bug in predict.ontologyLoss
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien.Prados committed Feb 13, 2018
1 parent f7df11a commit d406623
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bmrm/R/loss_convex.R
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ ontologyLoss <- function(x,y,l=1 - table(seq_along(y),y),dag=diag(nlevels(y))) {
#' @export
predict.ontologyLoss <- function(object,x,...) {
W <- array(object,attr(object,"model.dim"))
W <- tcrossprod(W,attr(object,"model.dag"))
dimnames(W) <- attr(object,"model.dimnames")
W <- tcrossprod(W,attr(object,"model.dag"))
f <- x %*% W
y <- max.col(f,ties.method="first")
y <- factor(colnames(W)[y],colnames(W))
Expand Down

0 comments on commit d406623

Please sign in to comment.