Hey everyone,
I found three issues in the library, they are written below sorted by their severity. Please go through them and suggest better fixes, if any.
1. "PMVector sum" - Here is the comparison with array:
a := ((1 to: 5000) collect: [ :i | i ]) asPMVector.
a sum. "Best of 10 runs: 568ms"
b := ((1 to: 25000000) collect: [ :i | i ]).
b sum. "Worst of 10 runs: 551ms"
This means that PMVector sum
is at least 5,000 times slower than Collection sum
.
Possible fix: Don't override sum
method. Is there any specific reason to override?
2. PMVector > < operators modify in-place:
x := #(1 2.5 3 4) asPMVector.
x > 2.
x. "==> a PMVector(false true true true)"
I have created a PR for it, here: https://github.com/PolyMathOrg/PolyMath/pull/123
Should additional operators like >= and <= be added in similar fashion as well?
3. PMStandardScaler fails when scale = 0 - happens when all elements in a column are equal. Possible fix: add a "handleZeroScale" method which changes scale to 1 when it is 0.
Question: Should this method be added in PMDataTransformer? If we add more scalers in future, all would need this message.
Hey everyone,
I found three issues in the library, they are written below sorted by their severity. Please go through them and suggest better fixes, if any.
1. "PMVector sum" - Here is the comparison with array:
a := ((1 to: 5000) collect: [ :i | i ]) asPMVector. a sum. "Best of 10 runs: 568ms" b := ((1 to: 25000000) collect: [ :i | i ]). b sum. "Worst of 10 runs: 551ms"
This means that
PMVector sum
is at least 5,000 times slower thanCollection sum
.Possible fix: Don't override
sum
method. Is there any specific reason to override?
"Programs must be written for people to read, and only incidentally for machines to execute." https://twitter.com/SergeStinckwich |