Home | Trees | Indices | Help |
|
---|
|
Abstract classifier class to be inherited by all classifiers
Required behavior:
For every classifier is has to be possible to be instanciated without having to specify the training pattern.
Repeated calls to the train() method with different training data have to result in a valid classifier, trained for the particular dataset.
It must be possible to specify all classifier parameters as keyword arguments to the constructor.
Recommended behavior:
Derived classifiers should provide access to values -- i.e. that information that is finally used to determine the predicted class label.
state member. This variable is a list as long as and in same order as Dataset.uniquelabels (training data). Each item in the list corresponds to the likelyhood of a sample to belong to the respective class. However the sematics might differ between classifiers, e.g. kNN would probably store distances to class- neighbours, where PLR would store the raw function value of the logistic function. So in the case of kNN low is predictive and for PLR high is predictive. Don't know if there is the need to unify that.
As the storage and/or computation of this information might be demanding its collection should be switchable and off be default.
out labels by .predict()
makes a decision based on some internal value such as probability or a distance.
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
trained_labels = StateVariable(enabled= True, doc= "Set of uni
|
|||
trained_dataset = StateVariable(enabled= False, doc= "The data
|
|||
training_confusion = StateVariable(enabled= False, doc= "Confu
|
|||
predictions = StateVariable(enabled= True, doc= "Most recent s
|
|||
values = StateVariable(enabled= False, doc= "Internal classifi
|
|||
training_time = StateVariable(enabled= True, doc= "Time (in se
|
|||
predicting_time = StateVariable(enabled= True, doc= "Time (in
|
|||
feature_ids = StateVariable(enabled= False, doc= "Feature IDS
|
|||
_clf_internals = [] Describes some specifics about the classifier -- is that it is doing regression for instance.... |
|||
retrainable = property(fget= _getRetrainable, fset= _setRetrai
|
|||
Inherited from |
|
|||
_train2predict Some classifiers might not need to be trained to predict |
|||
__trainednfeatures Stores number of features for which classifier was trained. |
|||
_regression If True - perform regression, not classification |
|||
__retrainable If True - store anything necessary for efficient retrain |
|||
__trainedidhash Stores id of the dataset on which it was trained to signal in trained() if it was trained already on the same dataset |
|
|||
Inherited from Inherited from |
|
|
|
Functionality post training For instance -- computing confusion matrix :Parameters: dataset : Dataset Data which was used for training |
Virtual method to return feature_ids used while training Is not intended to be called anywhere but from _posttrain, thus classifier is assumed to be trained at this point |
Train classifier on a dataset Shouldn't be overriden in subclasses unless explicitely needed to do so |
Predict classifier on data Shouldn't be overriden in subclasses unless explicitely needed to do so. Also subclasses trying to call super class's predict should call _predict if within _predict instead of predict() since otherwise it would loop |
Either classifier was already trained. MUST BE USED WITH CARE IF EVER |
|
|
|
|
trained_labels
|
trained_dataset
|
training_confusion
|
predictions
|
values
|
training_time
|
predicting_time
|
feature_ids
|
retrainable
|
|
__trainednfeaturesStores number of features for which classifier was trained. If None -- it wasn't trained at all |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Jun 1 19:01:48 2008 | http://epydoc.sourceforge.net |