Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Your will need to install the classification feature for this. See https://git.swl.informatik.uni-oldenburg.de/projects/OI/repos/classification/browse for further information and a german thesis for further information.

Beneath the already existing existing Machine Learning Feature, we provide a new (experimental) feature, that focuses on classfication and utilizes the Aggregation operator for this. To use this feature, you need to install the Classification Feature.

...

  • LABEL_ATTRIBUTE: In the input data, which is the attribute with the label, that should be learned
  • WEKA_ALGORITHM: Which WEKA Algorithm should be used. At the moment, the following algorithms are available. See WEKA for more information:
    • BayesNet
    • NaiveBayes
    • NaiveBayesMultinomial
    • NaiveBayesUpdateable
    • GaussianProcesses
    • Logistic
    • MultilayerPerceptron
    • SimpleLogistic
    • SMO
    • IBk
    • KStar
    • LWL
    • DecisionTable
    • JRip
    • OneR
    • PART
    • DecisionStump
    • HoeffdingTree
    • J48
    • LMT
    • RandomForest
    • RandomTree
    • REPTree
  • WEKA_OPTIONS: The options that should be given for the algorithm (see https://weka.sourceforge.io/doc.stable/weka/classifiers/Classifier.html for information about the given parameters)
  • GROUP_BY (Optional): Grouping Attributes that should be used.
  • ATTRIBUTES (Optional): Attributes that should be used for building the classifier. If not given, the input schema will be used. If not given and group_by is given, the attributes are the input attributes without the group_by attributes. 

Important: EVAL_AT_NEW_ELEMENT = false, EVAL_BEFORE_REMOVE_OUTDATING = true must be provided this way. Currently, there is no check, for this and output may be wrong.

It is now (2024-03-08) possible to use grouping for the aggregation version. In this case, for each Group the will be trained an individuell classifier IN THIS CASE YOU WILL NEED TO USE INPUT_ATTRIBUTES as option to define the attributes that should be used for training (without the grouping attributes). If you use this, then the classifier must use the same attribute for grouping!

IncrementalClassificationLearner

...

  • The first input is the source with the data, that should be classified (remark, this must be the same content as the Learner, without the label of course)
  • The second input is the classifier to use. This can be retrieved from a learner operator or read from outside.

The operator can be used with the following parameters:

  • ATTRIBUTES: A list of input attributes from the testadata that should be used for classification. If not given, any input attribute will be used. This is helpful if attributes should be keept in the output that are not part of the classification, e.g. in a fuel price scenario the id of the fuel station.


Code Block
classified = CLASSIFICATION(testdata, classifier)

...

It is also possible to use trained weka classifiertclassifiers, that are not stored with Odysseus. In this case you will need to use a FilteredClassifier as meta classifier. In options add the wanted classifier. If data are based on strings, add StringToNominalFilter else add NumericToNominalFilter as option. Learn model and store. See following activity diagram (in german).

TODO: Translate

Weka beinhaltet Filter die dem Lernprozess vorausgehen können. Diese können unter anderem Attribute mit Zeichenketten oder numerischen Werten in Attribute mit nominalen Werten umwandeln. Der implementierte WekaClassifierWrapper unterstützt nur nominale Attribute, daher muss beim Lernen des Klassifikators in Weka in jedem Fall ein entsprechender Filter vorausgehen. Die Zuordnung der Zeichenketten, beziehungsweise Zahlen zu den nominalen Werten wird dabei auch im WekaClassifierWrapper benötigt und seinem Konstruktor übergeben. Damit Weka diese Zuordnung beim Speichern eines Modells anhängt,  muss der Filter über einen speziellen Meta-Klassifikator FilteredClassifier vorgeschaltet werden. Nachdem der Klassifikator konfiguriert und gelernt wurde, kann er gespeichert werden und beinhaltet die erforderliche Zuordnung. 

In this case, you can load the classifier from a file:

Code Block
classified = CLASSIFICATION({
                  PATHTOMODEL = '${PROJECTPATH}\wekamodel.model'
                },
                toClassify
              )


Original Weka Classifier

This operator has the following optional parameter:

isWekaModel: This factor makes it possible to use a model trained in Weka (outside of Odysseus) as input on port 1. The following example shows a use case, where the Weka model is first loaded from a database and then used in the CLASSIFICATION operator:


Code Block
timer = TIMER({PERIOD = 1000000000, SOURCE = 'testdata'}) 

wekaModel = dbenrich({connection='connection3', query='SELECT id, model_name, labels, model_content, output_attributes FROM trained_models where id=5', multiTupleOutput='false', attributes=[]}, timer) 

classified = CLASSIFICATION({isWekaModel='true'}, testdata, wekaModel)