aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/jumpavg/classify.py
AgeCommit message (Collapse)AuthorFilesLines
2023-06-07feat(jumpavg): support small values via unit paramVratko Polak1-12/+32
Previously, Jumpavg was known to give wrong results when the data contains values of order one or smaller. This change introduces a new "unit" parameter, which changes how the information content is calculated. For example if the data values are mutiplies of 0.01, the unit parameter should be set to 0.01 to compensate. For callers not knowing their correct unit value, another parameter is introduced, called "sbps" (meaning Significant Bits Per Sample). A binary integer number with this many ones is how much units should the maximal sample be. This way jumpavg computes the corresponding "unit" value to use. If neither "unit" nor "sbps" are given, the "sbps" value of 12 is applied. + Rename files to conform to snake_style naming. + Fix normalization for the "opposite triangle" distribution. + Simplify logic, all groups now start as "normal", not "unknown". + Minor style improvements as suggested by pylint. + From user perspective, this change should be backward compatible. - The normalization fix is a behavior change, but it is a bugfix and the new behavior should be better. Change-Id: I5a5ca11757f087fff13faf1d0b8e34a741400258 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2022-08-15feat(jumpavg): speed up, use Python 3.8 featuresVratko Polak1-22/+24
+ The main speedup comes from abandoning copy.deepcopy(), doing shallow list copies (at most) and introcuding copy_fast(). + Turn into dataclasses whenever possible, use type hints. + Simplify the partition search code, + It is now clearer the time complexity is O(N*(N+n)), where N is number of samples, and n is the average size of the last group of the current record glist. + Used black for formatting, so no u"" anymore. + Update metadata for 0.3.0 release. Change-Id: I302203b4d42aeb22be1128e2fe72353a44eae5d0 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-06-10FIX: Pylint reducepmikus1-1/+1
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I909942dbb920df7f0fe15c0c92cda92c3cd8d8ad
2019-12-02Refactor jumpavg to be more readable and usableVratko Polak1-0/+76
This is the python3 change, the python2 is still used for testing bisect. + New version is 0.2.0 due to amount o API changes. + Jumpavg is now part of CSIT resource package tree. + Perpatch migrated to new jumpavg. - PAL NOT updated (the update moved to a different Change). Change-Id: I7d7a8bf8a411196c20c2a40a8c64478d6709bc07 Signed-off-by: Vratko Polak <vrpolak@cisco.com>