import("partykit", "graphics")

importFrom("e1071", 
           "classAgreement")

importFrom("MASS", 
           "mvrnorm")

importFrom("grDevices", 
           "gray.colors", "n2mfrow")

importFrom("methods", 
           "formalArgs", "new")
  
importFrom("stats", 
           "cor", "formula", "na.exclude", "plogis", "quantile", "rbinom", 
           "toeplitz", "var", "getCall", "model.frame", "na.omit", "terms", 
           "update", "predict", "as.formula", "terms.formula")

importFrom("parallel", 
           "mclapply")

importFrom("randomForest",
           "getTree")

importFrom("ranger",
           "treeInfo")

importClassesFrom("party", "RandomForest")

export(
  ## stability assessment
  "stabletree",
  "stability",
  "stab_control",
  "accuracy",
  "tuner",

  ## adding new learners
  "addLearner",
  "getLearner",
  "LearnerList",

  ## utiltiy functions
  "similarity_values",

  ## data-generating function
  "dgp_twoclass",
  
  ## similarity and dissimilarity measures
  "clagree", "ckappa", "bdist", "tvdist", "hdist", "jsdiv",
  "edist", "msdist", "rmsdist", "madist", "qadist", "cprob", "ccc", "pcc", "cosine", "rbfkernel", "tanimoto",

  ## sampler convenience functions
  "bootstrap",
  "subsampling",
  "samplesplitting",
  "jackknife",
  "splithalf",

  ## stabletree coercion generic
  "as.stabletree"
)

S3method("getCall", "cforest")

S3method("barplot", "stabletree")
S3method("image", "stabletree")
S3method("plot", "stabletree")
S3method("print", "stabletree")
S3method("summary", "stabletree")
S3method("print", "summary.stabletree")

S3method("print", "stablelearner")
S3method("summary", "stablelearner")
S3method("boxplot", "stablelearner")

S3method("print", "stablelearnerList")
S3method("summary", "stablelearnerList")
S3method("print", "summary.stablelearnerList")
S3method("boxplot", "stablelearnerList")

S3method("as.stabletree", "randomForest")
S3method("as.stabletree", "RandomForest")
S3method("as.stabletree", "cforest")
S3method("as.stabletree", "ranger")
