edu.harvard.seas.iis.abilities.classify
Class PositiveAndUnlabeledClassifier

java.lang.Object
  extended by weka.classifiers.Classifier
      extended by edu.harvard.seas.iis.abilities.classify.PositiveAndUnlabeledClassifier
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, weka.core.CapabilitiesHandler, weka.core.OptionHandler, weka.core.RevisionHandler

public class PositiveAndUnlabeledClassifier
extends weka.classifiers.Classifier

Author:
Charles Herrmann, kgajos This classifier learns from positive and unlabeled examples. It is an implementation of the methods described in Elkan, C., & Noto, K. (2008). Learning classifiers from only positive and unlabeled data. KDD '08: Proceeding of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining.
See Also:
Serialized Form

Constructor Summary
PositiveAndUnlabeledClassifier()
           
PositiveAndUnlabeledClassifier(weka.classifiers.Classifier baseClassifier)
           
PositiveAndUnlabeledClassifier(weka.classifiers.Classifier baseClassifier, java.lang.String[] features)
           
 
Method Summary
 void buildClassifier(weka.core.Instances trainSet)
           
 void buildClassifier1(weka.core.Instances trainSet)
           
 void buildClassifier2(weka.core.Instances trainSet)
           
 void buildClassifier3(weka.core.Instances trainSet)
           
 double classifyInstance(weka.core.Instance point)
           
static PositiveAndUnlabeledClassifier deserializeFromFile(java.io.File f)
           
 double[] distributionForInstance(weka.core.Instance inst)
           
 java.lang.String[] getAllowedFeatures()
           
 double getDeliberateProbability(weka.core.Instance point)
          Returns the probability that a particular movement (represented by the Instance) was deliberate
 int getMethodForEvaluatingC()
           
 void setAllowedFeatures(java.lang.String[] allowedFeatures)
           
 void setMethodForEvaluatingC(int methodForEvaluatingC)
           
 java.lang.String toString()
           
 
Methods inherited from class weka.classifiers.Classifier
debugTipText, forName, getCapabilities, getDebug, getOptions, getRevision, listOptions, makeCopies, makeCopy, setDebug, setOptions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PositiveAndUnlabeledClassifier

public PositiveAndUnlabeledClassifier()
                               throws java.lang.Exception
Throws:
java.lang.Exception

PositiveAndUnlabeledClassifier

public PositiveAndUnlabeledClassifier(weka.classifiers.Classifier baseClassifier)

PositiveAndUnlabeledClassifier

public PositiveAndUnlabeledClassifier(weka.classifiers.Classifier baseClassifier,
                                      java.lang.String[] features)
Parameters:
baseClassifier - the underlying probabilistic classifier (See the paper for more details);
features - names of features that should be used by the classifier (this allows for some features to be ignored); this list has to include the "Class" feature
Method Detail

getMethodForEvaluatingC

public int getMethodForEvaluatingC()

setMethodForEvaluatingC

public void setMethodForEvaluatingC(int methodForEvaluatingC)

getAllowedFeatures

public java.lang.String[] getAllowedFeatures()

setAllowedFeatures

public void setAllowedFeatures(java.lang.String[] allowedFeatures)

classifyInstance

public double classifyInstance(weka.core.Instance point)
                        throws java.lang.Exception
Overrides:
classifyInstance in class weka.classifiers.Classifier
Throws:
java.lang.Exception

getDeliberateProbability

public double getDeliberateProbability(weka.core.Instance point)
                                throws java.lang.Exception
Returns the probability that a particular movement (represented by the Instance) was deliberate

Parameters:
point -
Returns:
Throws:
java.lang.Exception

distributionForInstance

public double[] distributionForInstance(weka.core.Instance inst)
                                 throws java.lang.Exception
Overrides:
distributionForInstance in class weka.classifiers.Classifier
Throws:
java.lang.Exception

buildClassifier

public void buildClassifier(weka.core.Instances trainSet)
                     throws java.lang.Exception
Specified by:
buildClassifier in class weka.classifiers.Classifier
Throws:
java.lang.Exception

buildClassifier1

public void buildClassifier1(weka.core.Instances trainSet)
                      throws java.lang.Exception
Throws:
java.lang.Exception

buildClassifier2

public void buildClassifier2(weka.core.Instances trainSet)
                      throws java.lang.Exception
Throws:
java.lang.Exception

buildClassifier3

public void buildClassifier3(weka.core.Instances trainSet)
                      throws java.lang.Exception
Throws:
java.lang.Exception

deserializeFromFile

public static PositiveAndUnlabeledClassifier deserializeFromFile(java.io.File f)
                                                          throws java.io.IOException,
                                                                 java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object