Description Usage Arguments Value Examples
View source: R/descale.tweakedFeature.R
Restore tweaked instances to the original scale
1 | descale.tweakedFeature(tweaked.X, scaled.X)
|
tweaked.X |
an object returned by tweak() to be restored. |
scaled.X |
a scaled matrixa or a scaled data.frame. Usually train set or test set. |
a list of
"original" a data.frame of the same instances before being scalsed.
"suggest" a data.frame of instances tweakd in original scale.
"diff" a tibble of (suggest - original)
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
X <- iris[, 1:(ncol(iris)-1)]
scaled.X <- scale(X)
true.y <- iris[, ncol(iris)]
rf.iris <- randomForest(scaled.X, true.y, ntree=30)
es.rf <- set.eSatisfactory(forest.rf, ntree = 30, epsiron = 0.3, resample = TRUE)
tweaked <- tweak(es.rf, newdata= scaled.X, label.from = "spam", label.to = "nonspam",
.dopar = TRUE)
dt <- descale.tweakedFeature(tweaked, scaled.X)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.