|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.seas.iis.abilities.classify.MovementClassifier
public class MovementClassifier
A front end class with high level tools for classifying pointing movements as deliberate or distracted; uses pre-trained classifiers to perform the classification so it is all ready to go.
Field Summary | |
---|---|
static java.lang.String |
DELIBERATE_PROBABILITY_KEY
|
static java.lang.String |
PREDICTED_CLASS_KEY
|
static java.lang.String |
REPORT_HEADER
|
Constructor Summary | |
---|---|
MovementClassifier()
Initializes the class and loads the default serialized versions of the classifiers from the following location in the classpath: edu/harvard/seas/iis/abilities/classify/resources/ |
|
MovementClassifier(java.lang.String classifierDirectory)
Initializes the class and loads serialized classifiers from the location indicated in classifierDirectory variable |
Method Summary | |
---|---|
void |
classifyMovements(java.util.Collection<Movement> movements,
java.util.Vector<Movement> deliberate,
java.util.Vector<Movement> distracted,
boolean useTargetInformation)
Takes movements and classifies them; classified movements are added to the deliberate and distracted vectors |
DataSet |
classifyMovements(DataSet movements,
boolean useTargetInformation)
Assumes the movements data set has "Predicted class" and "Prediction probability" attributes present. |
double |
getDeliberateProbability(weka.core.Instance movement,
boolean useTargetInformation)
Returns the probability that the movement was deliberate |
double |
getDeliberateProbability(Movement movement,
boolean useTargetInformation)
Returns the probability that the movement was deliberate; also modifies the movement object by adding two pieces of meta data: "deliberate probability" and "predicted class" |
static void |
main(java.lang.String[] args)
|
java.util.Vector<Movement> |
parseAndClassify(java.io.File[] files,
MovementFilter filter,
Parser parser,
boolean useTargetInformation,
boolean returnParsedMovements,
java.util.Vector<java.lang.String> report)
Reads log files, uses the parser to extract movements out of the log files, uses the filter to select only the subset of the movements that are of interest, and classifies them. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DELIBERATE_PROBABILITY_KEY
public static final java.lang.String PREDICTED_CLASS_KEY
public static final java.lang.String REPORT_HEADER
Constructor Detail |
---|
public MovementClassifier()
public MovementClassifier(java.lang.String classifierDirectory)
classifierDirectory
- the location where the serialized classifiers may be foundMethod Detail |
---|
public void classifyMovements(java.util.Collection<Movement> movements, java.util.Vector<Movement> deliberate, java.util.Vector<Movement> distracted, boolean useTargetInformation) throws java.lang.Exception
movements
- movement objects to be classifieddeliberate
- movements classified as deliberate will be added to this
vectordistracted
- movements classified as distracted will be added to this
vectoruseTargetInformation
- if set to true, the classifier will make use of features that
rely on the knowledge of the target size; if set to false, the
classification will be done in a target agnostic manner
java.lang.Exception
public double getDeliberateProbability(Movement movement, boolean useTargetInformation) throws java.lang.Exception
movement
- Movement to classifyuseTargetInformation
- if set to true, the classifier will make use of features that
rely on the knowledge of the target size; if set to false, the
classification will be done in a target agnostic manner
java.lang.Exception
public double getDeliberateProbability(weka.core.Instance movement, boolean useTargetInformation) throws java.lang.Exception
movement
- movement already encoded as a Weka Instance, transformed to
include additional features, and normalized!useTargetInformation
- if set to true, the classifier will make use of features that
rely on the knowledge of the target size; if set to false, the
classification will be done in a target agnostic manner
java.lang.Exception
public DataSet classifyMovements(DataSet movements, boolean useTargetInformation) throws java.lang.Exception
movements
- movements encoded as Weka Intances; they have to have had
additional features already computed and they have to have
been normalized before being passed hereuseTargetInformation
-
java.lang.Exception
public java.util.Vector<Movement> parseAndClassify(java.io.File[] files, MovementFilter filter, Parser parser, boolean useTargetInformation, boolean returnParsedMovements, java.util.Vector<java.lang.String> report) throws java.lang.Exception
files
- log files from which the movements are to be extractedfilter
- filter for selecting a subset of the movements to be
classified; if null, all movements get classifiedparser
- instance of Parser for extracting Movements from the loguseTargetInformation
- if set to true, the classifier will make use of features that
rely on the knowledge of the target size; if set to false, the
classification will be done in a target agnostic mannerreturnParsedMovements
- will return a vector of Movement objects if this parameter is
set to true; will return an empty vector otherwise; useful, if
all that is needed is the report and not the movements
themselvesreport
- a string report will be appended to this variable
java.lang.Exception
public static void main(java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |