Package PyML :: Package classifiers :: Module template
[frames] | no frames]

Source Code for Module PyML.classifiers.template

 1  from baseClassifiers import Classifier 
 2   
3 -class Template(Classifier) :
4 5 """A template for a pyml classifier""" 6 7 attributes = {} 8
9 - def __init__(self, arg = None, **args) :
10 11 Classifier.__init__(self, **args)
12
13 - def train(self, data, **args) :
14 15 Classifier.train(self, data, **args) 16 17 # this should be the last command in the train function 18 # if you redefine the "test" function you can follow the code in 19 # assess.test to save the testingTime 20 self.log.trainingTime = self.getTrainingTime()
21 22
23 - def decisionFunc(self, data, i) :
24 25 return margin
26
27 - def classify(self, data, i) :
28 29 return (margin, classification)
30