Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/GenAlgo
01 January 2021, 04:13:10 UTC
  • Code
  • Branches (5)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/2.1.3
    • refs/tags/2.1.4
    • refs/tags/2.1.5
    • refs/tags/2.2.0
    • 7476f7f38f6427cdb2ebc6307fe4ef95eb338de9
    No releases to show
  • 9337931
  • /
  • man
  • /
  • genalg.Rd
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:00c9de05a4417d0f05352301cc686f0825871279
origin badgedirectory badge Iframe embedding
swh:1:dir:58b83137a1f79af2f5eb4b93873551e6d65f07bd
origin badgerevision badge
swh:1:rev:7476f7f38f6427cdb2ebc6307fe4ef95eb338de9
origin badgesnapshot badge
swh:1:snp:908bea40927100b6d5e6aad50b0ee1e6e85dd112
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 7476f7f38f6427cdb2ebc6307fe4ef95eb338de9 authored by Kevin R. Coombes on 15 October 2020, 16:40:03 UTC
version 2.2.0
Tip revision: 7476f7f
genalg.Rd
\name{GenAlg}
\alias{GenAlg}
\alias{newGeneration}
\alias{popDiversity}
\title{
  A generic Genetic Algorithm for feature selection
}
\description{
  These functions allow you to initialize (\code{GenAlg}) and iterate
  (\code{newGeneration}) a genetic algorithm to perform feature
  selection for binary class prediction in the context of gene
  expression microarrays or other high-throughput technologies.
}
\usage{
GenAlg(data, fitfun, mutfun, context, pm=0.001, pc=0.5, gen=1)
newGeneration(ga)
popDiversity(ga)
}
\arguments{
  \item{data}{
    The initial population of potential solutions, in the form of a data
    matrix with one individual per row.}
  \item{fitfun}{
    A function to compute the fitness of an individual solution. Must take
    two input arguments: a vector of indices into rows of the population
    matrix, and a \code{context} list within which any other items required
    by the function can be resolved. Must return a real number; higher values
    indicate better fitness, with the maximum fitness occurring at the optimal
    solution to the underlying numerical problem.}
  \item{mutfun}{
    A function to mutate individual alleles in the population. Must take two
    arguments: the starting allele and a \code{context} list as in the
    fitness function.}
  \item{context}{
    A list of additional data required to perform mutation or to compute
    fitness. This list is passed along as the second argument when
    \code{fitfun} and \code{mutfun} are called.}
  \item{pm}{
    A real value between \code{0} and \code{1}, representing the probability
    that an individual allele will be mutated.}
  \item{pc}{
    A real value between \code{0} and \code{1}, representing the probability
    that crossover will occur during reproduction.}
  \item{gen}{
    An integer identifying the current generation.}
  \item{ga}{
    An object of class \code{GenAlg}}
}
\value{
  Both the \code{GenAlg} generator and the \code{newGeneration} functions
  return a \code{\link{GenAlg-class}} object. The \code{popDiversity} function
  returns a real number representing the average diversity of the population.
  Here diversity is defined by the number of alleles (selected features) that
  differ in two individuals.
}
\author{
  Kevin R. Coombes \email{krc@silicovore.com},
  P. Roebuck \email{proebuck@mdanderson.org}
}
\seealso{
  \code{\link{GenAlg-class}},
  \code{\link{GenAlg-tools}},
  \code{\link{maha}}.
}
\examples{
# generate some fake data
nFeatures <- 1000
nSamples <- 50
fakeData <- matrix(rnorm(nFeatures*nSamples), nrow=nFeatures, ncol=nSamples)
fakeGroups <- sample(c(0,1), nSamples, replace=TRUE)
myContext <- list(dataset=fakeData, gps=fakeGroups)

# initialize population
n.individuals <- 200
n.features <- 9
y <- matrix(0, n.individuals, n.features)
for (i in 1:n.individuals) {
  y[i,] <- sample(1:nrow(fakeData), n.features)
}

# set up the genetic algorithm
my.ga <- GenAlg(y, selectionFitness, selectionMutate, myContext, 0.001, 0.75)

# advance one generation
my.ga <- newGeneration(my.ga)

}
\keyword{optimize}

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API