haifengl / smile

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

Add XMeans with float array type #739

Open DobryninVyacheslav opened 1 year ago

DobryninVyacheslav commented 1 year ago

In our application, we use a model to turn text into a vector with the float type. Then we convert this vector into a double array for XMeans clustering, after which we convert it back to float to save it in a vector database. We would not like to make these extra conversions. It is also important for us to use float because of the lower memory consumption.

Could you make XMeans work with float arrays as well?

haifengl commented 1 year ago

Will do

DobryninVyacheslav commented 1 year ago

Thank you!

DobryninVyacheslav commented 1 year ago

Can I implement XMeans with float types? If yes, what is the best way to do it? The easiest option is to make a copy with float types instead of double. Would that be acceptable or do you prefer another solution?

haifengl commented 1 year ago

There are many dependency class of double[]. I am research a systematic way to support different precisions, which is not easy on Java.

DobryninVyacheslav commented 1 year ago

understood thanks