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


Python SkillModel._deltas_names方法代码示例

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


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

示例1: test_deltas_names_with_controls_and_constant

# 需要导入模块: from skillmodels import SkillModel [as 别名]
# 或者: from skillmodels.SkillModel import _deltas_names [as 别名]
    def test_deltas_names_with_controls_and_constant(self):
        self.add_constant = True

        d_boo = [np.ones((6, 2), dtype=bool), np.ones((3, 3), dtype=bool),
                 np.ones((4, 2), dtype=bool)]
        for i in range(3):
            d_boo[i][0, 0] = False
        self._deltas_bool = Mock(return_value=d_boo)
        fs = 'delta__{}__{}__{}'
        expected_names = \
            [fs.format(0, 'm0', 'c1'), fs.format(0, 'm0', 'c2'),
             fs.format(0, 'm1', 'constant'), fs.format(0, 'm1', 'c1'),
             fs.format(0, 'm1', 'c2'),
             fs.format(0, 'm2', 'constant'), fs.format(0, 'm2', 'c1'),
             fs.format(0, 'm2', 'c2'),
             fs.format(0, 'm3', 'constant'), fs.format(0, 'm3', 'c1'),
             fs.format(0, 'm3', 'c2'),
             fs.format(0, 'm4', 'constant'), fs.format(0, 'm4', 'c1'),
             fs.format(0, 'm4', 'c2'),
             fs.format(0, 'm5', 'constant'), fs.format(0, 'm5', 'c1'),
             fs.format(0, 'm5', 'c2'),
             fs.format(1, 'm6', 'c1'), fs.format(1, 'm6', 'c2'),
             fs.format(1, 'm6', 'c3'),
             fs.format(1, 'm7', 'constant'), fs.format(1, 'm7', 'c1'),
             fs.format(1, 'm7', 'c2'), fs.format(1, 'm7', 'c3'),
             fs.format(1, 'm8', 'constant'), fs.format(1, 'm8', 'c1'),
             fs.format(1, 'm8', 'c2'), fs.format(1, 'm8', 'c3'),
             fs.format(2, 'm9', 'c3'), fs.format(2, 'm9', 'c4'),
             fs.format(2, 'm10', 'constant'), fs.format(2, 'm10', 'c3'),
             fs.format(2, 'm10', 'c4'),
             fs.format(2, 'm11', 'constant'), fs.format(2, 'm11', 'c3'),
             fs.format(2, 'm11', 'c4'),
             fs.format(2, 'm12', 'constant'), fs.format(2, 'm12', 'c3'),
             fs.format(2, 'm12', 'c4')]

        assert_equal(smo._deltas_names(self, params_type='short'),
                     expected_names)
开发者ID:suri5471,项目名称:skillmodels,代码行数:39,代码来源:skill_model_test.py

示例2: test_deltas_names_without_controls_beside_constant

# 需要导入模块: from skillmodels import SkillModel [as 别名]
# 或者: from skillmodels.SkillModel import _deltas_names [as 别名]
    def test_deltas_names_without_controls_beside_constant(self):
        self.controls = [[], [], []]
        d_boo = [np.ones((6, 1), dtype=bool), np.ones((3, 1), dtype=bool),
                 np.ones((4, 1), dtype=bool)]
        self._deltas_bool = Mock(return_value=d_boo)
        fs = 'delta__{}__{}__{}'
        expected_names = \
            expected_names = \
            [fs.format(0, 'm0', 'constant'),
             fs.format(0, 'm1', 'constant'),
             fs.format(0, 'm2', 'constant'),
             fs.format(0, 'm3', 'constant'),
             fs.format(0, 'm4', 'constant'),
             fs.format(0, 'm5', 'constant'),
             fs.format(1, 'm6', 'constant'),
             fs.format(1, 'm7', 'constant'),
             fs.format(1, 'm8', 'constant'),
             fs.format(2, 'm9', 'constant'),
             fs.format(2, 'm10', 'constant'),
             fs.format(2, 'm11', 'constant'),
             fs.format(2, 'm12', 'constant')]

        assert_equal(smo._deltas_names(self, params_type='short'),
                     expected_names)
开发者ID:suri5471,项目名称:skillmodels,代码行数:26,代码来源:skill_model_test.py


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