Differences
This shows you the differences between two versions of the page.
|
projs:clans:docs:prediction_lib_utilanalz_smooth [2014/01/21 09:58] cheungzeecn created |
projs:clans:docs:prediction_lib_utilanalz_smooth [2014/01/21 09:59] (current) cheungzeecn |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| A simple filter filter a list consists of list(like [0, 1] for x=0, y=1), takes the noises off. | A simple filter filter a list consists of list(like [0, 1] for x=0, y=1), takes the noises off. | ||
| ===== Paramters ===== | ===== Paramters ===== | ||
| - | - x_y list of lists, | + | - x_y list of lists, x_y is a list like [[0, 0],[1, 1],] |
| - | x_y is a list like [[0, 0],[1, 1],] | + | |
| - threshold int, for threshold value, if the abs(value, other_value) more than threshold, the value may be a noise | - threshold int, for threshold value, if the abs(value, other_value) more than threshold, the value may be a noise | ||
| - poolN int, how long the polling poll is. For poolN=10, the function would look forward 10 items, back 10 items, than the items poll according to the parameter threshold. If the agreement more than a half, this point is not a noise. | - poolN int, how long the polling poll is. For poolN=10, the function would look forward 10 items, back 10 items, than the items poll according to the parameter threshold. If the agreement more than a half, this point is not a noise. | ||
| + | |||
| ===== Return ===== | ===== Return ===== | ||
| - a list that will return a smoothed list of data. | - a list that will return a smoothed list of data. | ||
| ===== Detail Information ===== | ===== Detail Information ===== | ||
| + | <code> | ||
| + | |||
| + | a = | ||
| + | [ | ||
| + | |||
| + | [6, 6], | ||
| + | [7, 7], | ||
| + | [8, 8], | ||
| + | [9, 9], | ||
| + | [10, 100], | ||
| + | [11, 11], | ||
| + | [12, 12], | ||
| + | [13, 13], | ||
| + | ] | ||
| + | |||
| + | smooth(a, int threshold=5, int poolN=3) | ||
| + | will return | ||
| + | [ | ||
| + | [6, 6], | ||
| + | [7, 7], | ||
| + | [8, 8], | ||
| + | [9, 9], | ||
| + | [11, 11], | ||
| + | [12, 12], | ||
| + | [13, 13], | ||
| + | ] | ||
| + | |||
| + | </code> | ||
| + | |||
| ===== Changelog ===== | ===== Changelog ===== | ||
| newly built, 2012-01-21 | newly built, 2012-01-21 | ||