Skip to content

Commit

Permalink
revert case
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax committed Dec 9, 2024
1 parent ca20a5c commit 849eeb0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
8 changes: 4 additions & 4 deletions R/SklearnClassifierSettings.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ setAdaBoost <- function(nEstimators = list(10, 50, 200),
}


adaBoostClassifierInputs <- function(classifier, param) {
AdaBoostClassifierInputs <- function(classifier, param) {
model <- classifier(
n_estimators = param[[which.max(names(param) == "nEstimators")]],
learning_rate = param[[which.max(names(param) == "learningRate")]],
Expand Down Expand Up @@ -330,7 +330,7 @@ setDecisionTree <- function(criterion = list("gini"),
}


decisionTreeClassifierInputs <- function(classifier, param) {
DecisionTreeClassifierInputs <- function(classifier, param) {
model <- classifier(
criterion = param[[which.max(names(param) == "criterion")]],
splitter = param[[which.max(names(param) == "splitter")]],
Expand Down Expand Up @@ -568,7 +568,7 @@ setNaiveBayes <- function() {
return(result)
}

gaussianNBInputs <- function(classifier, param) {
GaussianNBInputs <- function(classifier, param) {
model <- classifier()

return(model)
Expand Down Expand Up @@ -727,7 +727,7 @@ setRandomForest <- function(ntrees = list(100, 500),
}


randomForestClassifierInputs <- function(classifier, param) {
RandomForestClassifierInputs <- function(classifier, param) {
model <- classifier(
n_estimators = param[[which.max(names(param) == "ntrees")]],
criterion = param[[which.max(names(param) == "criterion")]],
Expand Down
2 changes: 1 addition & 1 deletion man/createFeatureEngineeringSettings.Rd

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

11 changes: 6 additions & 5 deletions man/setAdaBoost.Rd

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

6 changes: 3 additions & 3 deletions man/setDecisionTree.Rd

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

6 changes: 4 additions & 2 deletions man/setRandomForest.Rd

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

2 changes: 1 addition & 1 deletion man/setSVM.Rd

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

6 changes: 3 additions & 3 deletions tests/testthat/test-sklearnClassifierSettings.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_that("setAdaBoost settings work checks", {
expect_equal(attr(adset$param, "settings")$pythonClass, "AdaBoostClassifier")


inputs <- adaBoostClassifierInputs(list, adset$param[[1]])
inputs <- AdaBoostClassifierInputs(list, adset$param[[1]])
expect_equal(
names(inputs),
c("n_estimators", "learning_rate", "algorithm", "random_state")
Expand Down Expand Up @@ -101,7 +101,7 @@ test_that("setNaiveBayes settings work checks", {
expect_equal(attr(nbset$param, "settings")$pythonModule, "sklearn.naive_bayes")
expect_equal(attr(nbset$param, "settings")$pythonClass, "GaussianNB")

inputs <- gaussianNBInputs(list, nbset$param[[1]])
inputs <- GaussianNBInputs(list, nbset$param[[1]])
expect_equal(names(inputs), NULL)
})

Expand Down Expand Up @@ -137,7 +137,7 @@ test_that("setRandomForest settings work checks", {
expect_equal(attr(rfset$param, "settings")$pythonModule, "sklearn.ensemble")
expect_equal(attr(rfset$param, "settings")$pythonClass, "RandomForestClassifier")

inputs <- randomForestClassifierInputs(list, rfset$param[[1]])
inputs <- RandomForestClassifierInputs(list, rfset$param[[1]])
expect_equal(
names(inputs),
c(
Expand Down

0 comments on commit 849eeb0

Please sign in to comment.