|
||||||||||
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 String |
DELIBERATE_PROBABILITY_KEY
|
static String |
PREDICTED_CLASS_KEY
|
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(String classifierDirectory)
Initializes the class and loads serialized classifiers from the location indicated in classifierDirectory variable |
Method Summary | |
---|---|
void |
classifyMovements(Collection<Movement> movements,
Vector<Movement> deliberate,
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(String[] args)
|
Vector<Movement> |
parseAndClassify(File[] files,
MovementFilter filter,
Parser parser,
boolean useTargetInformation)
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 String DELIBERATE_PROBABILITY_KEY
public static final String PREDICTED_CLASS_KEY
Constructor Detail |
---|
public MovementClassifier()
public MovementClassifier(String classifierDirectory)
classifierDirectory
- the location where the serialized classifiers may be foundMethod Detail |
---|
public void classifyMovements(Collection<Movement> movements, Vector<Movement> deliberate, Vector<Movement> distracted, boolean useTargetInformation) throws 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
Exception
public double getDeliberateProbability(Movement movement, boolean useTargetInformation) throws 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
Exception
public double getDeliberateProbability(weka.core.Instance movement, boolean useTargetInformation) throws 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
Exception
public DataSet classifyMovements(DataSet movements, boolean useTargetInformation) throws 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
-
Exception
public Vector<Movement> parseAndClassify(File[] files, MovementFilter filter, Parser parser, boolean useTargetInformation) throws 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 manner
Exception
public static void main(String[] args) throws Exception
args
-
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |