ojAlgo MatrixR032 creation from string, normalization, and cosine similarity calculation
I have two comma delimited strings containing embeddings. Each index should be able to fit into a float and they are 128 elements long. I am following this linear algebra intro in the ojAlgo library. I'd like to convert the two strings to ojAlgo matrices, normalize them, and then compute their cosine similarity. I am testing with a single matrix first - I expect when I compute its cosine similarity it should be 1.0. PhysicalStore.Factory<Double, Primitive32Store> storeFactory = Primitive32Store.FACTORY; String dummyMatrixValues = "0.47058824,0.5647059,0.54901963,0.54509807,0.54901963"; Primiti
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.