AlineTalhouk / splendid

Supervised Learning Ensemble for Diagnostic Identification
https://alinetalhouk.github.io/splendid/
Other
1 stars 0 forks source link

Adaboost Classification Error #41

Closed Dustin21 closed 6 years ago

Dustin21 commented 6 years ago

Error in predict(f, newdata = dat, type = "class") : unused arguments (newdata = dat, type = "class")

Traceback of error is as follows:

10. predict(f, newdata = dat, type = "class") 9. predict.type(fit[[m]], dat) 8. maboost.machine.multi(x, ny, test.x, test.y, iter, smoothfactor, nu, bag.frac, random.feature, random.cost, lossObj, oldObj = NULL, na.action = na.action, ...) 7. maboost.default(data, class, breg = "entrap") 6. maboost::maboost(data, class, breg = "entrop") 5. force(expr) 4. sink_output(maboost::maboost(data, class, breg = "entrop")) 3. boost_model(data, class, "adaboost") 2. splendid::classification(data = x, class = lab, algorithms = alg, standardize = FALSE) 1. train(cbt.full, "adaboost")

Have you encountered this error before? Any idea if this could have been rectified in version 0.0.0.9022?

dchiu911 commented 6 years ago

I don't recall seeing this error. But in any case, the traceback isn't very informative. Best to make a reproducible example. It appears to be an error in the maboost method of prediction though. The latest version didn't address anything related to this, so this might be a new catch case...

Dustin21 commented 6 years ago

I've provided a reproducible example below:

data(hgsc)
class <- attr(hgsc, "class.true")
classification(hgsc, class, "adaboost")

which outputs the following error:

Error in predict(f, newdata = dat, type = "class") : 
  unused arguments (newdata = dat, type = "class")

Let me know if this helps.

dchiu911 commented 6 years ago

I did not run into any errors, perhaps try updating your OS/packages?

library(splendid)
data(hgsc)
class <- attr(hgsc, "class.true")
boost_mod <- classification(hgsc, class, "adaboost")
str(boost_mod, max.level = 1)
# List of 18
# $ model         :List of 8
# $ fit           : Factor w/ 4 levels "DIF.C4","IMM.C2",..: 4 3 1 3 3 4 1 3 2 4 ...
# $ call          : language maboost(x = data, y = class, breg = "entrop")
# $ confusion     : 'table' int [1:4, 1:4] 135 0 0 0 0 106 1 0 0 1 ...
# ..- attr(*, "dimnames")=List of 2
# $ iter          : num 100
# $ actual        : Factor w/ 4 levels "DIF.C4","IMM.C2",..: 4 3 1 3 3 4 1 3 2 4 ...
# $ nu            : num 0.1
# $ dim           : int [1:2] 489 321
# $ names         : chr [1:321] "ABAT" "ABHD2" "ACTB" "ACTR2" ...
# $ bag.frac      : num 0.5
# $ na.action     :function (x)  
#   $ Ctree         : logi FALSE
# $ maxmargin     : logi FALSE
# $ smooth        : logi FALSE
# $ smoothfactor  : num 1
# $ random.feature: logi TRUE
# $ random.cost   : logi TRUE
# $ sparse        : logi FALSE
# - attr(*, "class")= chr "maboost"

Are you sure that the error was triggered by the call to classification(hgsc, class, "adaboost")? The error message seems to imply predict was used.

AlineTalhouk commented 6 years ago

@dchiu911 I am actually encountering an error:

library(splendid)
data(hgsc)
class <- attr(hgsc, "class.true")
boost_mod <- classification(hgsc, class, "adaboost")

I get: Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘partykit’

dchiu911 commented 6 years ago

I do not get this error. Have you tried install.packages("partykit")?

AlineTalhouk commented 6 years ago

what version of R are you running @dchiu911

AlineTalhouk commented 6 years ago

@dchiu911 It's the package libcoin which is required for partykit, and won't run on my OS (because it needs the OS 10.11 and I have 10.10) what are you guys running?

dchiu911 commented 6 years ago
sessioninfo::platform_info()
# setting  value                       
# version  R version 3.4.3 (2017-11-30)
# os       macOS High Sierra 10.13.3   
# system   x86_64, darwin15.6.0        
# ui       RStudio                     
# language (EN)                        
# collate  en_CA.UTF-8                 
# tz       America/Vancouver           
# date     2018-02-06 

rstudioapi::getVersion()
# [1] ‘1.1.408’