haifengl / smile

Statistical Machine Intelligence & Learning Engine
https://haifengl.github.io
Other
5.97k stars 1.13k forks source link

Can't merge 2 KMeans clustering trained models calculated in different locations in codes #735

Closed ceecer1 closed 1 year ago

ceecer1 commented 1 year ago

val model1 = KMeans.fit(data1.x(), 3)

val model2 = KMeans.fit(data2.x(), 3)

How to merge this 2 models ? model1 and model2

Environment details:

OpenJDK 17 Scala 2.13.10 Smile 3.0.0 core and scala Intellij MacOS

haifengl commented 1 year ago

No such functionality. If you just want a union of centroids, you can do it by yourself as model.centroids is just an array.