DErand | R Documentation |
Learn parameters of a Bayesian Network in a discriminative way by Differential Evolution with variant rand/k
DErand(
NP = 40,
G = 100,
data,
class.name,
F = 0.5,
CR = 0.7,
mutation.pairs = c(1, 2),
crossover = c("bin", "exp"),
structure = c("nb", "tancl", "hc"),
edgelist = NULL,
verbose = 25,
...
)
NP |
positive integer giving the number of candidate solutions in the initial population. |
G |
positive integer specifying the maximum number of generations that may be performed before the algorithm is halted. |
data |
The data frame from which to learn the classifier. |
class.name |
A character. Name of the class variable. |
F |
A numeric. Mutation factor. Default is 0.5. |
CR |
A numeric. Cross over factor. Default is 0.7. |
mutation.pairs |
A positive integer giving the number of pairs (1 or 2) used in the mutation step. |
crossover |
A character. Crossover type among binomial (bin) or exponential (exp). |
structure |
A character. Name of the structure learning function. "tan" uses Tree Augmented Network. "nb" uses Naive Bayes. "hc" uses Hill Climbing. |
edgelist |
A matrix. An optional edge list to use a custom BN structure. that will replace de learned structure. |
verbose |
positive integer indicating the number of generations until the iteration progress should be printed. |
... |
other structure learning options from tan_cl or tan_hc. |
An object of class DE
, which is a list with the following components:
Best |
A |
BestCLL |
A numeric specifying the Conditional Log-Likelihood of the best individual. |
pobFinal |
A list of |
CLLPobFinal |
A numeric vector specifying the Conditional Log-Likelihood of the final population. |
N.evals |
An integer giving the total number of evaluations. |
convergence |
A numeric vector giving the maximum Conditional Log-Likelihood at each generation. |
evaluations |
An integer vector giving the total number of evaluations at each generation. |
# Load data
data(car)
# Parameter learning with "rand/2/bin" variant
dpl.rand2bin <- DErand(NP = 25, G = 40, data = car, class.name = names(car)[7], F = 0.5,
CR = 0.5, mutation.pairs = 2, crossover = "bin", structure = "tan", edgelist = NULL,
verbose = 10)
# Print results
print(dpl.rand2bin)
## Not run: plot(dpl.rand2bin)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.