[marf-cvs] marf/src/marf/Classification/RandomClassification RandomClassification.java, 1.19, 1.20
Brought to you by:
mokhov
From: Serguei A. M. <mo...@us...> - 2006-10-07 19:23:33
|
Update of /cvsroot/marf/marf/src/marf/Classification/RandomClassification In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31758/marf/Classification/RandomClassification Modified Files: RandomClassification.java Log Message: In response to the bug# 1568848, re-introduce explicit dump() and restore() with proper redirection of the DUMP modes back to the original as Classification alters them for the training set. Additionally, prevent null oIDs to be present when is read from the file. This fixes the bug and makes RandomClassification correct again. Index: RandomClassification.java =================================================================== RCS file: /cvsroot/marf/marf/src/marf/Classification/RandomClassification/RandomClassification.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** RandomClassification.java 31 Jul 2006 02:19:13 -0000 1.19 --- RandomClassification.java 7 Oct 2006 19:23:28 -0000 1.20 *************** *** 57,60 **** --- 57,62 ---- .append(getDefaultExtension()) .toString(); + + this.oObjectToSerialize = this.oIDs; } *************** *** 133,136 **** --- 135,139 ---- * @return <code>true</code> if training was successful * @throws ClassificationException + * @since 0.3.0.6 */ public final boolean train(double[] padFeatureVector) *************** *** 167,170 **** --- 170,225 ---- } + /* From Storage Manager */ + + /** + * Dumps "training set" of IDs. + * @throws StorageException + */ + public final void dump() + throws StorageException + { + switch(this.iCurrentDumpMode) + { + case DUMP_BINARY: + dumpBinary(); + break; + + case DUMP_GZIP_BINARY: + dumpGzipBinary(); + break; + + default: + super.dump(); + } + } + + /** + * Restores "training set" of IDs. + * @throws StorageException if there was an error loading the data file. + */ + public final void restore() + throws StorageException + { + switch(this.iCurrentDumpMode) + { + case DUMP_BINARY: + restoreBinary(); + break; + + case DUMP_GZIP_BINARY: + restoreGzipBinary(); + break; + + default: + super.restore(); + } + + if(this.oIDs == null) + { + this.oIDs = new Vector(); + this.oObjectToSerialize = this.oIDs; + } + } + /** * @see marf.Storage.StorageManager#backSynchronizeObject() |