classifier_wrapper¶
Module: missions.nodes.meta.classifier_wrapper
¶
Operate on classifiers
Inheritance diagram for pySPACE.missions.nodes.meta.classifier_wrapper
:
Class Summary¶
SplitClassifierLayerNode (classifier[, store]) |
Split the overrepresented class in the training set for multiple training. |
SVMComplexityLayerNode (classifier[, store, eps]) |
Calculate the minimal complexity, where the soft margin is inactive |
Classes¶
SplitClassifierLayerNode
¶
-
class
pySPACE.missions.nodes.meta.classifier_wrapper.
SplitClassifierLayerNode
(classifier, store=False, *args, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Split the overrepresented class in the training set for multiple training.
The node trains several classifiers with this splits such that both classes are nearly equally distributed.
Output is a set of predictions in a prediction vector. An ensemble node should follow to combine these classifications.
Parameter
Classifier: Classifier to be split. Notation is as usual as in the YAML file.
Maybe this will be changed later on.
Exemplary Call
- node : Split_Classifier parameters : classifier: - node : LibSVM_Classifier parameters : complexity : 1 weight : [1,3] debug : False store : False class_labels : ['Standard', 'Target']
Author: Mari Krell (mario.krell@dfki.de)
POSSIBLE NODE NAMES: - Split_Classifier
- SplitClassifierLayerNode
- SplitClassifierLayer
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_execute
(data)Process the data through the internal nodes. _stop_training
([debug])_train
(data, class_label)collects the data for training get_output_type
(input_type[, as_string])overwritten method from BaseNode input_types
is_supervised
()Returns whether this node requires supervised training is_trainable
()Returns whether this node is trainable. reset
()Reset the state to the clean state it had after its initialization -
input_types
= ['FeatureVector']¶
SVMComplexityLayerNode
¶
-
class
pySPACE.missions.nodes.meta.classifier_wrapper.
SVMComplexityLayerNode
(classifier, store=False, eps=0.001, *args, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.meta.classifier_wrapper.SplitClassifierLayerNode
Calculate the minimal complexity, where the soft margin is inactive
This node uses nested intervals and a tolerance variable is used to define when the accuracy is high enough and the slack variables are small enough. This was necessary because the libsvm classifier gives no exact solution and the slack variables may be never zero.
Output is the prediction of the given classifier with the given complexity multiplied by the found complexity. Wrapper around a classifier. The result should be analyzed with the classification performance sink node.
Parameter
Classifier: SVM Classifier to be analysed. Notation is as usual as in the YAML file.
Maybe this will be changed later on.
Exemplary Call
- node : Get_Complexity parameters : classifier: - node : LibSVM_Classifier parameters : complexity : 1 weight : [1,3] debug : False store : False class_labels : ['Standard', 'Target']
Author: Mario Krell (mario.krell@dfki.de)
POSSIBLE NODE NAMES: - SVMComplexityLayer
- Get_Complexity
- SVMComplexityLayerNode
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_execute
(data)Process the data through the internal nodes. _stop_training
([debug])_train
(data, class_label)It is assumed that the class_label parameter reset
()Reset the state to the clean state it had after its initialization