本文整理汇总了Python中scipy.stats.variation方法的典型用法代码示例。如果您正苦于以下问题:Python stats.variation方法的具体用法?Python stats.variation怎么用?Python stats.variation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.stats
的用法示例。
在下文中一共展示了stats.variation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_variation
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import variation [as 别名]
def test_variation(self):
#variation = samplestd/mean
## y = stats.variation(self.shoes[0])
## assert_almost_equal(y,21.8770668)
y = mstats.variation(self.testcase)
assert_almost_equal(y,0.44721359549996, 10)
示例2: test_variation
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import variation [as 别名]
def test_variation(self):
# variation = samplestd / mean
y = stats.variation(self.testcase)
assert_approx_equal(y,0.44721359549996, 10)
示例3: test_variation
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import variation [as 别名]
def test_variation(self):
y = mstats.variation(self.testcase)
assert_almost_equal(y,0.44721359549996, 10)
示例4: test_variation
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import variation [as 别名]
def test_variation(self):
# variation = samplestd / mean
y = stats.variation(self.scalar_testcase)
assert_approx_equal(y, 0.0)
y = stats.variation(self.testcase)
assert_approx_equal(y, 0.44721359549996, 10)
x = np.arange(10.)
x[9] = np.nan
assert_equal(stats.variation(x), np.nan)
assert_almost_equal(stats.variation(x, nan_policy='omit'),
0.6454972243679028)
assert_raises(ValueError, stats.variation, x, nan_policy='raise')
assert_raises(ValueError, stats.variation, x, nan_policy='foobar')
示例5: test_variation_propagate_nan
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import variation [as 别名]
def test_variation_propagate_nan(self):
# Check that the shape of the result is the same for inputs
# with and without nans, cf gh-5817
a = np.arange(8).reshape(2, -1).astype(float)
a[1, 0] = np.nan
vv = stats.variation(a, axis=1, nan_policy="propagate")
np.testing.assert_allclose(vv, [0.7453559924999299, np.nan], atol=1e-15)
示例6: all_features
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import variation [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
示例7: variation
# 需要导入模块: from scipy import stats [as 别名]
# 或者: from scipy.stats import variation [as 别名]
def variation(X):
""" coefficient of variation """
return stats.variation(X, axis=1)