/** * Main method for testing this class. * * @param args should contain <filestem>[.names | data] */ public static void main(String[] args) { runFileLoader(new C45Loader(), args); } }
/** * Determines and returns (if possible) the structure (internally the header) * of the data set as an empty set of instances. * * @return the structure of the data set as an empty set of Instances * @exception IOException if an error occurs */ @Override public Instances getStructure() throws IOException { if (m_sourceFile == null) { throw new IOException("No source has beenspecified"); } if (m_structure == null) { setSource(m_sourceFile); StreamTokenizer st = new StreamTokenizer(m_namesReader); initTokenizer(st); readHeader(st); } return m_structure; }
/** * Resets the Loader ready to read a new data set or the same data set again. * * @throws IOException if something goes wrong */ @Override public void reset() throws IOException { m_structure = null; setRetrieval(NONE); if (m_File != null) { setFile(new File(m_File)); } }
if (getRetrieval() == BATCH) { throw new IOException( "Cannot mix getting Instances in both incremental and batch modes"); setRetrieval(INCREMENTAL); getStructure(); initTokenizer(st); Instance nextI = getInstance(st); if (nextI != null) { nextI.setDataset(m_structure);
/** * returns the loader used in the tests * * @return the configured loader */ public AbstractLoader getLoader() { return new C45Loader(); }
public void setSource(File file) throws IOException { m_structure = null; setRetrieval(NONE);
val = removeTrailingPeriod(val); classVals.add(val); val = removeTrailingPeriod(val); attribVals.add(val);
throw new IOException("No source has been specified"); if (getRetrieval() == INCREMENTAL) { throw new IOException( "Cannot mix getting Instances in both incremental and batch modes"); setRetrieval(BATCH); if (m_structure == null) { getStructure(); initTokenizer(st); Instance current = getInstance(st); current = getInstance(st);
/** * returns the loader used in the tests * * @return the configured loader */ public AbstractLoader getLoader() { return new C45Loader(); }
public void setSource(File file) throws IOException { m_structure = null; setRetrieval(NONE);
val = removeTrailingPeriod(val); classVals.add(val); val = removeTrailingPeriod(val); attribVals.add(val);
throw new IOException("No source has been specified"); if (getRetrieval() == INCREMENTAL) { throw new IOException( "Cannot mix getting Instances in both incremental and batch modes"); setRetrieval(BATCH); if (m_structure == null) { getStructure(); initTokenizer(st); Instance current = getInstance(st); current = getInstance(st);
/** * Main method for testing this class. * * @param args should contain <filestem>[.names | data] */ public static void main(String[] args) { runFileLoader(new C45Loader(), args); } }
/** * Determines and returns (if possible) the structure (internally the header) * of the data set as an empty set of instances. * * @return the structure of the data set as an empty set of Instances * @exception IOException if an error occurs */ @Override public Instances getStructure() throws IOException { if (m_sourceFile == null) { throw new IOException("No source has beenspecified"); } if (m_structure == null) { setSource(m_sourceFile); StreamTokenizer st = new StreamTokenizer(m_namesReader); initTokenizer(st); readHeader(st); } return m_structure; }
/** * Resets the Loader ready to read a new data set or the same data set again. * * @throws IOException if something goes wrong */ @Override public void reset() throws IOException { m_structure = null; setRetrieval(NONE); if (m_File != null) { setFile(new File(m_File)); } }
if (getRetrieval() == BATCH) { throw new IOException( "Cannot mix getting Instances in both incremental and batch modes"); setRetrieval(INCREMENTAL); getStructure(); initTokenizer(st); Instance nextI = getInstance(st); if (nextI != null) { nextI.setDataset(m_structure);