本文整理匯總了Python中extractor.Extractor.extract_features方法的典型用法代碼示例。如果您正苦於以下問題:Python Extractor.extract_features方法的具體用法?Python Extractor.extract_features怎麽用?Python Extractor.extract_features使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類extractor.Extractor
的用法示例。
在下文中一共展示了Extractor.extract_features方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from extractor import Extractor [as 別名]
# 或者: from extractor.Extractor import extract_features [as 別名]
class Framework:
""""""
def __init__(self, classifier):
""""""
self.classifier = classifier
self.extractor = Extractor()
def _create_subjects(self):
""""""
return [Subject(FILE_NAMES['NormROIS'] % (file_index + 1))
for file_index in range(NUM_OF_SUBJECTS)]
def _train(self, classifier, features):
""""""
classifier.train(features)
def _classify(self, classifier):
""""""
classifier.classify()
def execute(self):
""""""
# 1) Load the data files
subjects = self._create_subjects()
# 2) Extract the features
self.extractor.extract_features(subjects)
print len(self.extractor.features['P']), exit()
# 3) Train the classifier
self._train(self.classifier, self.extractor.features)
# 4) Classify some data
self._classify(self.classifier)