optimization.GA: Core optimization function for finding optimal weights.

Description Usage Arguments Value See Also Examples

Description

Cognate pairs and their determined alignment generated in ALINE format is used to find a set of optimal parameters in terms of number of correctly aligned pairs. A genetic algorithm is executed. It is called in the optimize.features function and is the core function for the optimization part.

Usage

1
optimization.GA(Al, data, num, step = 5, plot = TRUE)

Arguments

Al

A 2*n matrix containing the correct alignment of the input

data

A 2*n matrix containing the pairs of words to be aligned

num

The size of initial population in the genetic algorithm

step

number of iterations for the genetic algorithm

plot

plot the convergence process of the algorithm

Value

R

a list, containing

performance

The number of correctly aligned pairs

optimized_parameters

a matrix containing all the optimal parameters after the optimization

See Also

optimize.features

Examples

1
2
3
4
data<-as.matrix(data.frame(dog=c('dog','perro'),cat=c('cat','gato'),rat=c('rat','rata')))
M<-generate.training(raw.data=data,search.size=100,table=FALSE)
alignment<-rbind(M[[2]][4,],M[[2]][5,])
optimization.GA(Al=alignment,data=data,num=5,step=3,plot=FALSE)

alineR documentation built on May 2, 2019, 11:26 a.m.