`ClusteringGA.CGAData`

— Type`ClusteringGA.CGAResult`

— Type`CGAResult <: ClusteringResult`

Contains the results from the computation of `cga`

.

**Members**

`assignments::Vector{Int}`

element-to-cluster assignments (`n`

)`counts::Vector{Int}`

number of samples assigned to each cluster (`k`

)`found_gen::Int`

first generation where the elite was found`total_gen::Int`

total generations the GA has been run

`ClusteringGA.cga`

— Method```
cga(objects::V,
distances::M=distance_matrix(objs),
N::Int=length(objs)*20,
generations::Int=50) where {S, V <: AbstractVector{S},
T <: Real, M <: AbstractMatrix{T}}
```

Compute the optimal clustering in the data by Genetic Algorithm over the computed mean silhouettes.

`objects`

the vector of the objects for which clusters are to be computed.`distances`

the distance matrix providing the pairwise distances bewtween the`objects`

`N`

the population size for GA computation`generations`

number of generations the GA has to be run

The `fitness`

function used is `1+mean(silhouettes())`

to ensure positive values.

**Return Values**

The method returns a tuple of (`CGAData`

, `CGAResult`

)

**References**

- Hruschka, Eduardo & Ebecken, Nelson. (2003). A genetic algorithm for cluster analysis. Intell. Data Anal.. 7. 15-25. 10.3233/IDA-2003-7103.