import(ggplot2)
import(methods)

importClassesFrom(kernlab, ksvm)
importClassesFrom(party, RandomForest)

importFrom(abind, abind, adrop)
importFrom(foreach, "%dopar%", foreach, registerDoSEQ)
importFrom(graphics, plot)
importFrom(magrittr, "%>%")
importFrom(recipes, bake, juice, prep, prepper)
importFrom(rsample, assessment, bootstraps, initial_split, rsample2caret,
           testing, vfold_cv)
importFrom(stats, aggregate, approx, coef, complete.cases, contr.helmert, cor,
           formula, get_all_vars, loess, median, model.frame, model.matrix,
           model.response, model.weights, na.fail, na.omit, na.pass, p.adjust,
           pchisq, predict, quantile, reformulate, reshape, sd, t.test, terms,
           vcov)
importFrom(survival, is.Surv, Surv, survfit)
importFrom(utils, combn, head, relist, stack, tail)


export(.,
       calibration,
       Calibration,
       confusion,
       Confusion,
       dependence,
       expand.model,
       fit,
       lift,
       Lift,
       metricinfo,
       ModelFrame,
       modelinfo,
       modelmetrics,
       performance,
       resample,
       Resamples,
       response,
       tune,
       varimp)

export(accuracy,
       brier,
       cindex,
       cross_entropy,
       f_score,
       gini,
       kappa2,
       mae,
       mse,
       msle,
       npv,
       ppv,
       pr_auc,
       precision,
       r2,
       recall,
       rmse,
       rmsle,
       roc_auc,
       roc_index,
       sensitivity,
       specificity,
       weighted_kappa2)

export(BootControl,
       CVControl,
       OOBControl,
       SplitControl,
       TrainControl)

export(MLControl,
       MLMetric,
       "MLMetric<-",
       MLModel,
       AdaBagModel,
       AdaBoostModel,
       BARTMachineModel,
       BlackBoostModel,
       C50Model,
       CForestModel,
       CoxModel,
       CoxStepAICModel,
       EarthModel,
       FDAModel,
       GAMBoostModel,
       GBMModel,
       GLMBoostModel,
       GLMModel,
       GLMStepAICModel,
       GLMNetModel,
       KNNModel,
       LARSModel,
       LDAModel,
       LMModel,
       MDAModel,
       NaiveBayesModel,
       NNetModel,
       PDAModel,
       PLSModel,
       POLRModel,
       QDAModel,
       RandomForestModel,
       RangerModel,
       RPartModel,
       StackedModel,
       SuperModel,
       SurvRegModel,
       SurvRegStepAICModel,
       SVMModel,
       SVMANOVAModel,
       SVMBesselModel,
       SVMLaplaceModel,
       SVMLinearModel,
       SVMPolyModel,
       SVMRadialModel,
       SVMSplineModel,
       SVMTanhModel,
       TreeModel,
       XGBModel,
       XGBDARTModel,
       XGBLinearModel,
       XGBTreeModel)

S3method(as.data.frame, ModelFrame)
S3method(diff, MLModelTune)
S3method(diff, Resamples)
S3method(fit, ModelFrame)
S3method(fit, formula)
S3method(fit, recipe)
S3method(ModelFrame, formula)
S3method(ModelFrame, matrix)
S3method(performance, factor)
S3method(performance, matrix)
S3method(performance, numeric)
S3method(performance, Resamples)
S3method(performance, Surv)
S3method(print, MLModelFit)
S3method(print, Resamples)
S3method(plot, MLModelTune)
S3method(plot, PartialDependence)
S3method(plot, Resamples)
S3method(plot, Calibration)
S3method(plot, Confusion)
S3method(plot, ConfusionMatrix)
S3method(plot, Lift)
S3method(plot, Performance)
S3method(plot, VarImp)
S3method(predict, MLModelFit)
S3method(resample, ModelFrame)
S3method(resample, formula)
S3method(resample, recipe)
S3method(response, formula)
S3method(response, recipe)
S3method(summary, Confusion)
S3method(summary, ConfusionMatrix)
S3method(summary, MLModelFit)
S3method(summary, MLModelTune)
S3method(summary, Performance)
S3method(summary, Resamples)
S3method(t.test, PerformanceDiff)
S3method(tune, ModelFrame)
S3method(tune, formula)
S3method(tune, recipe)
