本文整理汇总了Python中Classifier.Classifier.attachEventController方法的典型用法代码示例。如果您正苦于以下问题:Python Classifier.attachEventController方法的具体用法?Python Classifier.attachEventController怎么用?Python Classifier.attachEventController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Classifier.Classifier
的用法示例。
在下文中一共展示了Classifier.attachEventController方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LearnerBuilder
# 需要导入模块: from Classifier import Classifier [as 别名]
# 或者: from Classifier.Classifier import attachEventController [as 别名]
#.........这里部分代码省略.........
##
# Signals to use data from CSV file for testing dataset
#
# @param filename: Filename where to read the data from
# @return: LearnerBuilder object itself
def withTestingDataFromCSVFile(self, filename):
dataContainer = CSVAdapter(filename).loadData(DataContainer.TEST_CATEGORY)
if self.__learner.dataContainer != None:
self.__learner.setDataContainer(self.__learner.dataContainer.combine(dataContainer))
else:
self.__learner.setDataContainer(dataContainer)
return self
##
# Signals to use initial data for alpha vector from ARFF file
#
# @param filename: Filename where to read the data from
# @return: LearnerBuilder object itself
def withInitialAlphaFromARFFFile(self, filename):
alpha = LearnedKnowledgeFormatter().deserializeFromFile(filename)
self.__learner.alpha = alpha
self.__learner.knowledge.setMemento(alpha)
return self
##
# Attaches checkpoint controller to the learner
#
# @param controller: Checkpoint controller which implements LearnerEventController
# @return: LearnerBuilder
def withCheckpointController(self, controller):
self.__checkpointController = controller
self.__learner.attachEventController(self.__checkpointController)
self.__checkpointController.setGrid(self.__learner.grid)
self.__checkpointController.setLearnedKnowledge(self.__learner.knowledge)
self.__checkpointController.setLearner(self.__learner)
return self
##
# Attaches progress presentor to the learner
#
# @param presentor: progress presentor which implements LearnerEventController
# @return: LearnerBuilder
def withProgressPresenter(self, presentor):
self.__learner.attachEventController(presentor)
if self.__learner.solver != None:
self.__learner.solver.attachEventController(presentor)
return self
##
# Grid Descriptor helps to implement fluid interface patter on python
# it encapsulates functionality concerning creation of the grid
class GridDescriptor:
__builder = None
__deg = None
__level = None
__file = None
__border = None
__dim = None
## Constructor