|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.io.IOUtils
public class IOUtils
This class takes care of various I/O related tasks.
Constructor Summary | |
---|---|
IOUtils(org.apache.log4j.Logger logger,
ClassificationAction ca)
Constructor. |
Method Summary | |
---|---|
int |
getLinesInFile(java.io.File file)
Returns the number of lines (terminated by a carriage return) in the file |
java.io.File |
makeCopyAndDestroyOriginal(java.io.File original)
Makes a copy of the file (with a new name), and then destroys the original. |
static void |
mergeFiles(java.io.File output,
java.io.File[] files)
Merges a number of files, by which it is assumed that the lines are space-formatted, and contain space seperated fields. |
void |
writeCrossValidation(CrossValidationResult result,
java.io.File featureFile,
int trainPos,
int testPos,
int trainNeg,
int testNeg)
This methods writes the results of a crossvalidation to a file. |
void |
writeRocGnuPlotCommand(java.util.List<RocCurveData> fileNames,
java.lang.String path)
This method generates the Gnuplot-commands to display the roc-curves (only possible with cross-validation). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOUtils(org.apache.log4j.Logger logger, ClassificationAction ca)
logger
- Logging facility, really needed because a lot of methods
might cause problems and throw exceptions.ca
- The classificationAction to which this instantiaton of IOUtils belongs
to.Method Detail |
---|
public int getLinesInFile(java.io.File file)
file
- The file of which we want the number of lines
public java.io.File makeCopyAndDestroyOriginal(java.io.File original) throws java.io.IOException
original
- The original File
java.io.IOException
- When diskoperations/filesystemoperations failpublic static void mergeFiles(java.io.File output, java.io.File[] files) throws java.io.IOException, java.lang.NullPointerException
output
- The outputFilefiles
- The inputFiles
java.io.IOException
- Thrown when a diskoperation cannot be completed
java.lang.NullPointerException
- Thrown when a file is nullpublic void writeCrossValidation(CrossValidationResult result, java.io.File featureFile, int trainPos, int testPos, int trainNeg, int testNeg)
result
- The crossvalidation resultfeatureFile
- File containing the featurestrainPos
- The number positive training examples usedtestPos
- The number of positive test examples usedtrainNeg
- The number of negative training examples usedtestNeg
- The number of negative test examples usedpublic void writeRocGnuPlotCommand(java.util.List<RocCurveData> fileNames, java.lang.String path)
fileNames
- A list with all the filenames and data which contain roc-curve datapath
- The path in which to place the resulting gnuplot-command file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |