当前位置: 首页>>代码示例>>Python>>正文


Python Series.standardize方法代码示例

本文整理汇总了Python中thunder.rdds.series.Series.standardize方法的典型用法代码示例。如果您正苦于以下问题:Python Series.standardize方法的具体用法?Python Series.standardize怎么用?Python Series.standardize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thunder.rdds.series.Series的用法示例。


在下文中一共展示了Series.standardize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_standardization_axis1

# 需要导入模块: from thunder.rdds.series import Series [as 别名]
# 或者: from thunder.rdds.series.Series import standardize [as 别名]
 def test_standardization_axis1(self):
     rdd = self.sc.parallelize([(0, array([1, 2], dtype='float16')), (0, array([3, 4], dtype='float16'))])
     data = Series(rdd, dtype='float16')
     centered = data.center(1)
     standardized = data.standardize(1)
     zscored = data.zscore(1)
     assert(allclose(centered.first()[1], array([-1, -1]), atol=1e-3))
     assert(allclose(standardized.first()[1], array([1, 2]), atol=1e-3))
     assert(allclose(zscored.first()[1], array([-1, -1]), atol=1e-3))
开发者ID:MiguelPeralvo,项目名称:thunder,代码行数:11,代码来源:test_series.py

示例2: test_standardization_axis0

# 需要导入模块: from thunder.rdds.series import Series [as 别名]
# 或者: from thunder.rdds.series.Series import standardize [as 别名]
 def test_standardization_axis0(self):
     rdd = self.sc.parallelize([(0, array([1, 2, 3, 4, 5], dtype='float16'))])
     data = Series(rdd, dtype='float16')
     centered = data.center(0)
     standardized = data.standardize(0)
     zscored = data.zscore(0)
     assert(allclose(centered.first()[1], array([-2, -1, 0, 1, 2]), atol=1e-3))
     assert(allclose(standardized.first()[1], array([0.70710,  1.41421,  2.12132,  2.82842,  3.53553]), atol=1e-3))
     assert(allclose(zscored.first()[1], array([-1.41421, -0.70710,  0,  0.70710,  1.41421]), atol=1e-3))
开发者ID:MiguelPeralvo,项目名称:thunder,代码行数:11,代码来源:test_series.py

示例3: test_standardization_axis1

# 需要导入模块: from thunder.rdds.series import Series [as 别名]
# 或者: from thunder.rdds.series.Series import standardize [as 别名]
 def test_standardization_axis1(self):
     rdd = self.sc.parallelize([(0, array([1, 2])), (0, array([3, 4]))])
     data = Series(rdd)
     assert(allclose(data.center(1).first()[1], array([-1, -1])))
     assert(allclose(data.standardize(1).first()[1], array([1, 2])))
     assert(allclose(data.zscore(1).first()[1], array([-1, -1])))
开发者ID:getBioinfo,项目名称:thunder,代码行数:8,代码来源:test_series.py

示例4: test_standardization_axis0

# 需要导入模块: from thunder.rdds.series import Series [as 别名]
# 或者: from thunder.rdds.series.Series import standardize [as 别名]
 def test_standardization_axis0(self):
     rdd = self.sc.parallelize([(0, array([1, 2, 3, 4, 5]))])
     data = Series(rdd)
     assert(allclose(data.center(0).first()[1], array([-2, -1, 0, 1, 2])))
     assert(allclose(data.standardize(0).first()[1], array([0.70710,  1.41421,  2.12132,  2.82842,  3.53553])))
     assert(allclose(data.zscore(0).first()[1], array([-1.41421, -0.70710,  0,  0.70710,  1.41421])))
开发者ID:getBioinfo,项目名称:thunder,代码行数:8,代码来源:test_series.py


注:本文中的thunder.rdds.series.Series.standardize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。