Description Usage Arguments Value Examples
View source: R/simulated_annealing.R
Algorithm randomly chooses a set of features, trains on them, scores the model. Then the algorithm slightly modifies the chosen features randomly and tests to see if the model improves. If there is improvement, the newer model is kept, if not the algorithm tests to see if the worse model is still kept based on a acceptance probability that decreases as iterations continue and if the model performs worse.
1 2 3 4 5 6 7 8 9 | simulated_annealing(
scorer,
X,
y,
c = 1,
iterations = 100,
bools = FALSE,
random_state = NULL
)
|
scorer |
A custom user-supplied function that accepts X and y (as defined below) as input and returns the error of the datasets. |
X |
data frame of training features |
y |
data frame of training targets |
c |
control rate of feature perturbation |
iterations |
number of iterations |
bools |
If true function returns array of boolean values instead of column indicies |
random_state |
Seed for random number generators |
array of selected features
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.