JuliaStats / MultivariateStats.jl

A Julia package for multivariate statistics and data analysis (e.g. dimension reduction)
Other
379 stars 86 forks source link

Remove number of classes parameter from *-LDA #199

Closed wildart closed 2 years ago

wildart commented 2 years ago

Previously, in MC-LDA & SubLDA, labels required to be from a set of integers in the range 1:nc where nc is a total number of classes. That created a problem when some labels in this range where not present in the label collection. e.g. [1,1,3,3,3] label collection has two classes but maximum value of label is 3. This was intentional design decision because label set was used for indexing features during calculation of feature centers. Thus, to avoid incorrect indexing the number of classes parameter was used. This PR removes the "number of classes" parameter and estimates a number of classes from a number of unique labels. Additionally, PR removes type limitation on label collection.