本文整理汇总了Python中Classifier.Classifier.effect[i]方法的典型用法代码示例。如果您正苦于以下问题:Python Classifier.effect[i]方法的具体用法?Python Classifier.effect[i]怎么用?Python Classifier.effect[i]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Classifier.Classifier
的用法示例。
在下文中一共展示了Classifier.effect[i]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cover_triple
# 需要导入模块: from Classifier import Classifier [as 别名]
# 或者: from Classifier.Classifier import effect[i] [as 别名]
def cover_triple(percept_: list, action: int, percept: list, t: int) -> Classifier:
child = Classifier()
for i in range(len(percept)):
if percept_[i] != percept[i]:
child.condition[i] = percept_[i]
child.effect[i] = percept[i]
child.action = action
child.exp = 0
child.r = 0
child.aav = 0
child.alp = t
child.tga = t
child.t = t
child.q = 0.5
child.num = 1
return child
示例2: unexpected_case
# 需要导入模块: from Classifier import Classifier [as 别名]
# 或者: from Classifier.Classifier import effect[i] [as 别名]
def unexpected_case(clas: Classifier, percept: list, percept_: list) -> Classifier:
"""
:rtype: Classifier
"""
assert (len(percept_) == cons.lenCondition), "Wrong leight"
assert (len(percept) == cons.lenCondition), "Wrong leight"
clas.q = clas.q - cons.beta * clas.q
clas.mark = percept_
for i in range(len(percept)):
if clas.effect[i] != cons.symbol:
if clas.effect[i] != percept_[i] or percept_[i] != percept[i]:
return None
child = Classifier(clas)
for i in range(len(percept)):
if clas.effect[i] == cons.symbol and percept_[i] != percept[i]:
child.condition[i] = percept_[i]
child.effect[i] = percept[i]
if clas.q < 0.5:
clas.q = 0.5
child.exp = 1
return child