Commit 37ae2e3
committed
fix: resolve LSI dimension mismatch with native Ruby SVD
Native Ruby SVD returns transposed matrix dimensions when
row_size < column_size (common case: few terms, many documents).
This caused ExceptionForMatrix::ErrDimensionMismatch during
classification with 10+ similar documents.
Two changes:
- Transpose reduced matrix when dimensions don't match input
- Iterate over column_size (documents) not row_size (terms)
Fixes #721 parent 6e43186 commit 37ae2e3
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
336 | 344 | | |
337 | 345 | | |
338 | 346 | | |
| |||
0 commit comments