本文整理汇总了Python中scipy.stats.median_absolute_deviation方法的典型用法代码示例。如果您正苦于以下问题:Python stats.median_absolute_deviation方法的具体用法?Python stats.median_absolute_deviation怎么用?Python stats.median_absolute_deviation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.stats
的用法示例。
在下文中一共展示了stats.median_absolute_deviation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: all_features
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import median_absolute_deviation [as 别名]
def all_features():
""" Returns dictionary of all features in the module
.. note:: Some of the features (hist4, corr) are relatively expensive to compute
"""
features = {'mean': mean,
'median': median,
'gmean': gmean,
'hmean': hmean,
'vec_sum': vec_sum,
'abs_sum': abs_sum,
'abs_energy': abs_energy,
'std': std,
'var': var,
'mad': median_absolute_deviation,
'variation': variation,
'min': minimum,
'max': maximum,
'skew': skew,
'kurt': kurt,
'mean_diff': mean_diff,
'mean_abs_diff': means_abs_diff,
'mse': mse,
'mnx': mean_crossings,
'hist4': hist(),
'corr': corr2,
'mean_abs_value': mean_abs,
'zero_crossings': zero_crossing(),
'slope_sign_changes': slope_sign_changes(),
'waveform_length': waveform_length,
'emg_var': emg_var,
'root_mean_square': root_mean_square,
'willison_amplitude': willison_amplitude()}
return features
示例2: mad_wavelet
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import median_absolute_deviation [as 别名]
def mad_wavelet(image):
""" image: Median absolute deviation of the first wavelet scale.
(WARNING: sorry to disapoint, this is not a wavelet for mad scientists)
Parameters
----------
image: array
An image or cube of images
Returns
-------
mad: array
median absolute deviation for each image in the cube
"""
sigma = mad(Starlet(image, lvl = 2).coefficients[:,0,...], axis = (-2,-1))
return sigma
示例3: median_absolute_deviation
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import median_absolute_deviation [as 别名]
def median_absolute_deviation(X):
""" median absolute deviation for each variable in a segmented time series """
return stats.median_absolute_deviation(X, axis=1)
示例4: test_mad
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import median_absolute_deviation [as 别名]
def test_mad():
from scipy.stats import median_absolute_deviation
x = np.arange(50)
assert np.isclose(util.mad(x), median_absolute_deviation(x, scale=1))