You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know what the original intention was (@hofnerb), but given that cf is a numeric matrix, I think that condition will always be FALSE.
In the particular application, the base learner was a Markov random field over 327 regions. Here are the runtimes I get for evaluating the above condition as a function of mstop:
for (mstopin10^(2:5)) {
cat(mstop, ": ")
cf<-matrix(0, 327, mstop) # the actual values are irrelevant for this runtime assessment
cat(system.time(any(sapply(cf, is.null)))["elapsed"], "s\n")
}
#> 100 : 0.009 s#> 1000 : 0.109 s#> 10000 : 1.094 s#> 1e+05 : 20.04 s
Maybe that condition should be fixed to really "check if base-learner has coefficients". Otherwise the ret <- NULL case could simply be dropped. It would fail anyway when trying to set names on NULL later on.
The text was updated successfully, but these errors were encountered:
We hence cannot simply remove the check. I am wondering a bit, though, why we have the sapply bit. Are there lists of coefficients or does (is.null(cf)) not work for specific coefficient objects we might have?
Ok, I see. Maybe the check could be done earlier and more efficiently? Something like bastistician@50a0392 ? Of course, being an mboost noob, I have no idea whether checking the first element for being NULL is sufficient to conclude that the base learner has no coefs.
Profiling
coef.mboost
for a colleague, I have noticed that it seems to waste time to "check if base-learner has coefficients" here:mboost/R/mboost.R
Line 430 in 021e406
I don't know what the original intention was (@hofnerb), but given that
cf
is a numeric matrix, I think that condition will always be FALSE.In the particular application, the base learner was a Markov random field over 327 regions. Here are the runtimes I get for evaluating the above condition as a function of
mstop
:Maybe that condition should be fixed to really "check if base-learner has coefficients". Otherwise the
ret <- NULL
case could simply be dropped. It would fail anyway when trying to set names onNULL
later on.The text was updated successfully, but these errors were encountered: