Skip to content

Commit

Permalink
Merge pull request #8 from awsm-research/issue-7
Browse files Browse the repository at this point in the history
Fix issue #7 doMC does not support Windows
  • Loading branch information
klainfo authored Mar 22, 2019
2 parents b85ac67 + a692a3e commit 3c79a63
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Authors@R: c(
Maintainer: Chakkrit Tantithamthavorn <[email protected]>
Imports:
Hmisc,
car,
rms,
C50,
caret,
Expand All @@ -17,7 +18,7 @@ Imports:
reshape2,
foreign,
DMwR,
doMC,
doParallel,
ranger,
e1071,
foreach
Expand Down
6 changes: 6 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ import(dendextend)
import(pROC)
import(reshape2)
importFrom(C50,C5.0)
importFrom(C50,C5.0Control)
importFrom(DMwR,SMOTE)
importFrom(Hmisc,rcorr)
importFrom(Hmisc,varclus)
importFrom(car,Anova)
importFrom(caret,createFolds)
importFrom(caret,downSample)
importFrom(caret,train)
importFrom(caret,trainControl)
importFrom(caret,twoClassSummary)
importFrom(caret,upSample)
importFrom(caret,varImp)
importFrom(doParallel,registerDoParallel)
importFrom(e1071,svm)
importFrom(foreach,foreach)
importFrom(foreign,read.arff)
Expand Down
4 changes: 3 additions & 1 deletion R/fit.parallel.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
#' @param validation.params a list of parameters for an input validation techniques (default: list(cv.k = 10, boot.n = 100))
#' @param prob.threshold a numeric for probability threshold (default: 0.5)
#' @param repeats a numeric for number of repetitions (default: 1)
#' @param n.cores a numeric for number of cores (default: 2)
#' @importFrom caret createFolds downSample upSample
#' @importFrom DMwR SMOTE
#' @importFrom foreach foreach
#' @importFrom stats as.formula glm predict sd
#' @importFrom doParallel registerDoParallel
#' @keywords fit

fit.parallel <-
Expand Down Expand Up @@ -49,7 +51,7 @@ fit.parallel <-
repeats = 1,
n.cores = 2) {
# Init variables
registerDoMC(n.cores)
registerDoParallel(cores = n.cores)
data.nrow <- nrow(data)
outcome <- NULL
if (!is.factor(data[, dep])) {
Expand Down
5 changes: 3 additions & 2 deletions R/single.fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
#' @param classifier.params a list of parameters for an input classifier technique
#' @param params.tuning a boolean indicates whether to perform parameters tuning
#' @param prob.threshold a numeric for probability threshold (default: 0.5)
#' @importFrom caret train
#' @importFrom C50 C5.0
#' @importFrom caret train trainControl varImp twoClassSummary
#' @importFrom C50 C5.0 C5.0Control
#' @importFrom ranger ranger
#' @importFrom e1071 svm
#' @importFrom stats as.formula glm predict
#' @importFrom car Anova
#' @keywords fit
#' @export
single.fit <-
Expand Down
2 changes: 2 additions & 0 deletions man/fit.parallel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3c79a63

Please sign in to comment.