Description Usage Arguments Value Author(s) Examples
This function allows the users to run all GARS funtion at once. This is the easier and recommended way to use GARS.
1 2 3 4 5 | GARS_GA(data, classes, chr.num = 1000, chr.len, generation = 500,
co.rate = 0.8, mut.rate = 0.01, n.elit = 10, type.sel = c("RW",
"TS"), type.co = c("one.p", "two.p"), type.one.p.co = c("I.quart",
"II.quart", "III.quart"), n.gen.conv = 80, plots = c("yes", "no"),
n.Feat_plot = 10, verbose = c("yes", "no"))
|
data |
A
' |
classes |
The class vector |
chr.num |
The number of chromosomes to generate. Default is 1000 |
chr.len |
The length of chromosomes. This value corresponds to the desired length of the feature set |
generation |
The maximum number of generations. Default is 1000 |
co.rate |
The probability of each random couple of chromosomes to swap some parts. It must be between 0 and 1. Default is 0.8 |
mut.rate |
The probability to apply a random mutation to each element. It must be between 0 and 1. Default is 0.01 |
n.elit |
The number of best chromosomes to be selected by elitism. This number must be even. Default is 10 |
type.sel |
The type of selection method; Roulette Wheel ("RW") and Tournament Selection ("TS") are allowed. Default is "RW" |
type.co |
The type of crossover method; one-point ("one.p") and two-point ("two.p") are allowed. Default is "one.p" |
type.one.p.co |
The position of the cromosome where performing the crossover, if "one.p" is selected. The first quartile ("I.quart"), the second quartile ("II.quart", i.e. the median) and the third quartile ("III.quart") are allowed. Default is "I.quart" |
n.gen.conv |
The number of consecutive generations with the same maximum fitness score. |
plots |
If graphs have to be plotted; "yes" or "no" are allowed. Default is "yes" |
n.Feat_plot |
The number of features to be plotted |
verbose |
If statistics have to be printed; "yes" or "no" are allowed. Default is "yes" |
A GarsSelectedFeatures object, containg:
a matrix of selected features
a matrix containg the last chromosome population
a list containing all the populations produced over the generations
a numeric vector containing the maximum fitness scores, computed in each generation
Mattia Chiesa, Luca Piacentini
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # use example data:
data(GARS_data_norm)
data(GARS_classes)
res_ex <- GARS_GA(GARS_data_norm,
GARS_classes,
chr.num = 100,
chr.len=10,
generation = 5,
co.rate = 0.8,
mut.rate = 0.1,
n.elit = 10,
type.sel = "RW",
type.co ="one.p",
type.one.p.co = "II.quart",
n.gen.conv = 80,
plots = "no",
verbose = "no")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.