本文整理汇总了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)
示例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)