leila.classifiers
Class Classifier

java.lang.Object
  extended by leila.classifiers.Classifier
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
KNNClassifier, SVMClassifier

public abstract class Classifier
extends java.lang.Object
implements java.io.Serializable

This class is part of LEILA (http://mpii.de/yago-naga/leila). It is licensed under the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0) by the author Fabian M. Suchanek (http://suchanek.name).

Classifier.java represents a Classifier for a set of FeatureObjects. Predefined Classifiers are KNNClassifier and SVMClassifier.

See Also:
Serialized Form

Field Summary
 java.util.Map<Bridge,StoredBridge> bridgeMap
          Maps all distinct bridges to their StoredBridge
protected  boolean isContracted
          Tells whether contract() has been called
protected  int numFeatureObjects
          Contains number of featureObjects
 
Constructor Summary
Classifier()
           
 
Method Summary
abstract  void add(LinkagePattern o)
          Adds a new LinkagePattern
abstract  double classify(LinkagePattern o)
          Tells whether the classifier classifies a LinkagePattern as positive
 void print()
          Prints this classifier to System.out
abstract  void printTo(java.io.Writer o)
          Prints this classifier
 java.lang.String toString()
          Returns the list of featureObjects, might be long, so use printTo instead!
abstract  void train()
          Trains the classifier on all added FeatureObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isContracted

protected boolean isContracted
Tells whether contract() has been called


numFeatureObjects

protected int numFeatureObjects
Contains number of featureObjects


bridgeMap

public java.util.Map<Bridge,StoredBridge> bridgeMap
Maps all distinct bridges to their StoredBridge

Constructor Detail

Classifier

public Classifier()
Method Detail

add

public abstract void add(LinkagePattern o)
                  throws java.lang.Exception
Adds a new LinkagePattern

Throws:
java.lang.Exception

toString

public java.lang.String toString()
Returns the list of featureObjects, might be long, so use printTo instead!

Overrides:
toString in class java.lang.Object

printTo

public abstract void printTo(java.io.Writer o)
                      throws java.lang.Exception
Prints this classifier

Throws:
java.lang.Exception

print

public void print()
           throws java.lang.Exception
Prints this classifier to System.out

Throws:
java.lang.Exception

classify

public abstract double classify(LinkagePattern o)
                         throws java.lang.Exception
Tells whether the classifier classifies a LinkagePattern as positive

Throws:
java.lang.Exception

train

public abstract void train()
                    throws java.lang.Exception
Trains the classifier on all added FeatureObjects

Throws:
java.lang.Exception