All Packages Class Hierarchy This Package Previous Next Index
Class jsvm.SvmTest
java.lang.Object
|
+----jsvm.SvmTest
- public class SvmTest
- extends Object
Test routines for the Svm class.
- Version:
- $Id$
- Author:
- Heloise Hse (hwawen@eecs.berkeley.edu)
-
SvmTest()
-
-
buildTwice(String, String)
- Loads a training data file
- Builds models based on the data
- Loads another training data file
- Builds models based on the new set of data
Result: Exception will be thrown because after building the first
set of models, the data structure must be cleared before building
another set of models.
-
buildTwiceCorrect(String, String, String, String)
- Loads a training data file
- Builds models
- Writes models to file
- Removes data structure
- Loads another training data file
- Builds models
- Writes models to file
Result: Successfully writes the two sets of models to files m1 and m2.
-
classifyFromFile(String, String, String)
- Loads a model file
- Classifies a data file
- Writes predictions to a file
-
classifyOneExample(String)
- Loads a training data file
- Builds models
- Generates an example
- Classifies the example
- Prints confidence values to standard out
Result: Successfully classifies the example and prints out a
list of distribution values.
-
classifyWithoutModels()
- Generates an example
- Classifies the example
- Prints a list of confidence values
Result: Exception thrown because models do not exist.
-
loadAndBuild(String, String)
- Loads a training data file, builds models, and writes models to
a file.
-
loadBuildClassify(String, String)
- Loads a training data file
- Builds models
- Loads a test data file
- Classifies
-
loadModelAndClassify(String)
- Loads a model file
- Creates an example
- Classifies the example
Result: prints out the distribution values as the result of
classifying the example.
-
loadTwoModelFiles(String, String)
- Loads model file
- Loads another model file
Result: Exception thrown because if models already exist,
the program cannot load another model file.
-
main(String[])
-
-
multiLoadAndBuild(String, String, String, String, String, String)
- Creates 3 Svm instances, loads training data into each, build models,
and writes models out to files.
-
multiLoadBuildClassify(String, String, String, String)
- Creates 3 Svm instances, loads training data into each, build models,
and classifies the test examples.
-
multiSvm()
- Creates 2 Svm instances and sets the verbosity level.
-
testLoadTrainingData(String)
- Reads and parses a training data file.
SvmTest
public SvmTest()
testLoadTrainingData
public void testLoadTrainingData(String fname)
- Reads and parses a training data file. Prints
the data structure to standard out.
- Parameters:
- fname - The name of the training data file.
loadAndBuild
public void loadAndBuild(String in,
String out) throws IOException, SvmException
- Loads a training data file, builds models, and writes models to
a file.
- Parameters:
- in - The name of the training data file.
- out - The name of the output model file.
buildTwice
public void buildTwice(String f1,
String f2) throws IOException, SvmException
- Loads a training data file
- Builds models based on the data
- Loads another training data file
- Builds models based on the new set of data
Result: Exception will be thrown because after building the first
set of models, the data structure must be cleared before building
another set of models.
- Parameters:
- f1 - The name of the first training data file.
- f2 - The name of the second training data file.
buildTwiceCorrect
public void buildTwiceCorrect(String f1,
String f2,
String m1,
String m2) throws IOException, SvmException
- Loads a training data file
- Builds models
- Writes models to file
- Removes data structure
- Loads another training data file
- Builds models
- Writes models to file
Result: Successfully writes the two sets of models to files m1 and m2.
- Parameters:
- f1 - The first training data file name.
- f2 - The second training data file name.
- m1 - The name of the first model file to write out to.
- m2 - The name of the second model file to write out to.
classifyOneExample
public void classifyOneExample(String fname) throws IOException, SvmException
- Loads a training data file
- Builds models
- Generates an example
- Classifies the example
- Prints confidence values to standard out
Result: Successfully classifies the example and prints out a
list of distribution values.
- Parameters:
- fname - The name of the training data file.
classifyWithoutModels
public void classifyWithoutModels() throws SvmException
- Generates an example
- Classifies the example
- Prints a list of confidence values
Result: Exception thrown because models do not exist.
loadTwoModelFiles
public void loadTwoModelFiles(String m1,
String m2) throws SvmException, IOException
- Loads model file
- Loads another model file
Result: Exception thrown because if models already exist,
the program cannot load another model file. The existing
models must be removed first before the next sets can be loaded.
- Parameters:
- m1 - The name of the first model file.
- m2 - The name of the second model file.
classifyFromFile
public void classifyFromFile(String datFile,
String modelFile,
String predFile) throws SvmException, IOException
- Loads a model file
- Classifies a data file
- Writes predictions to a file
- Parameters:
- datFile - The name of the test data file.
- modelFile - The name of the input model file.
- predFile - The name of the output prediction file.
loadModelAndClassify
public void loadModelAndClassify(String fname) throws SvmException, IOException
- Loads a model file
- Creates an example
- Classifies the example
Result: prints out the distribution values as the result of
classifying the example.
- Parameters:
- fname - The name of the input model file.
multiSvm
public void multiSvm()
- Creates 2 Svm instances and sets the verbosity level.
Result: Each Svm instance should receive different ID
number. svm1 has verbosity level of 3, and svm2 has verbosity
level of 1.
multiLoadAndBuild
public void multiLoadAndBuild(String in,
String out,
String in2,
String out2,
String in3,
String out3) throws IOException, SvmException
- Creates 3 Svm instances, loads training data into each, build models,
and writes models out to files.
- Parameters:
- in - The name of the training data file for the first Svm.
- out - The name of the output model file for the first Svm.
- in2 - The name of the training data file for the second Svm.
- out2 - The name of the output model file for the second Svm.
- in3 - The name of the training data file for the third Svm.
- out3 - The name of the output model file for the third Svm.
multiLoadBuildClassify
public void multiLoadBuildClassify(String in,
String in2,
String in3,
String testfile) throws IOException, SvmException
- Creates 3 Svm instances, loads training data into each, build models,
and classifies the test examples.
- Parameters:
- in - The name of the training data file for the first Svm.
- in2 - The name of the training data file for the second Svm.
- in3 - The name of the training data file for the third Svm.
- testfile - The name of the test data file.
loadBuildClassify
public void loadBuildClassify(String in,
String testfile) throws IOException, SvmException
- Loads a training data file
- Builds models
- Loads a test data file
- Classifies
- Parameters:
- in - The name of the training data file.
- test - The name of the test data file.
main
public static void main(String[] argv)
All Packages Class Hierarchy This Package Previous Next Index