mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-12-27 09:59:10 +00:00
reduced random blank lines
This commit is contained in:
parent
de0cb1a4e3
commit
0991757ddb
@ -201,6 +201,7 @@ def basic_stats(data):
|
|||||||
@jit(forceobj=True)
|
@jit(forceobj=True)
|
||||||
def z_score(point, mean, stdev):
|
def z_score(point, mean, stdev):
|
||||||
score = (point - mean) / stdev
|
score = (point - mean) / stdev
|
||||||
|
|
||||||
return score
|
return score
|
||||||
|
|
||||||
# expects 2d array, normalizes across all axes
|
# expects 2d array, normalizes across all axes
|
||||||
@ -208,9 +209,7 @@ def z_score(point, mean, stdev):
|
|||||||
def z_normalize(array, *args):
|
def z_normalize(array, *args):
|
||||||
|
|
||||||
array = np.array(array)
|
array = np.array(array)
|
||||||
|
|
||||||
for arg in args:
|
for arg in args:
|
||||||
|
|
||||||
array = preprocessing.normalize(array, axis = arg)
|
array = preprocessing.normalize(array, axis = arg)
|
||||||
|
|
||||||
return array
|
return array
|
||||||
@ -220,13 +219,9 @@ def z_normalize(array, *args):
|
|||||||
def histo_analysis(hist_data):
|
def histo_analysis(hist_data):
|
||||||
|
|
||||||
hist_data = np.array(hist_data)
|
hist_data = np.array(hist_data)
|
||||||
|
|
||||||
derivative = np.array(len(hist_data) - 1, dtype = float)
|
derivative = np.array(len(hist_data) - 1, dtype = float)
|
||||||
|
|
||||||
t = np.diff(hist_data)
|
t = np.diff(hist_data)
|
||||||
|
|
||||||
derivative = t[1] / t[0]
|
derivative = t[1] / t[0]
|
||||||
|
|
||||||
np.sort(derivative)
|
np.sort(derivative)
|
||||||
|
|
||||||
return basic_stats(derivative)[0], basic_stats(derivative)[3]
|
return basic_stats(derivative)[0], basic_stats(derivative)[3]
|
||||||
|
Loading…
Reference in New Issue
Block a user