/** * Set the environment variables to use. * * @param env the environment variables to use */ @Override public void setEnvironment(Environment env) { m_env = env; if (m_outputFile != null) { try { // try and resolve any new environment variables setFile(m_outputFile); } catch (IOException ex) { // we won't complain about it here... } } }
/** * Set the environment variables to use. * * @param env the environment variables to use */ @Override public void setEnvironment(Environment env) { m_env = env; if (m_outputFile != null) { try { // try and resolve any new environment variables setFile(m_outputFile); } catch (IOException ex) { // we won't complain about it here... } } }
/** * Sets the destination file. * * @param outputFile the destination file. * @throws IOException throws an IOException if file cannot be set */ @Override public void setFile(File outputFile) throws IOException { if (outputFile.getAbsolutePath().endsWith( JSONLoader.FILE_EXTENSION_COMPRESSED)) { setCompressOutput(true); } super.setFile(outputFile); }
/** * Sets the destination file. * * @param outputFile the destination file. * @throws IOException throws an IOException if file cannot be set */ @Override public void setFile(File outputFile) throws IOException { if (outputFile.getAbsolutePath().endsWith( XRFFLoader.FILE_EXTENSION_COMPRESSED)) { setCompressOutput(true); } super.setFile(outputFile); }
/** * Sets the destination file. * * @param outputFile the destination file. * @throws IOException throws an IOException if file cannot be set */ @Override public void setFile(File outputFile) throws IOException { if (outputFile.getAbsolutePath().endsWith( ArffLoader.FILE_EXTENSION_COMPRESSED)) { setCompressOutput(true); } super.setFile(outputFile); }
/** * Sets the destination file. * * @param outputFile the destination file. * @throws IOException throws an IOException if file cannot be set */ @Override public void setFile(File outputFile) throws IOException { if (outputFile.getAbsolutePath().endsWith( XRFFLoader.FILE_EXTENSION_COMPRESSED)) { setCompressOutput(true); } super.setFile(outputFile); }
/** * Sets the destination file. * * @param outputFile the destination file. * @throws IOException throws an IOException if file cannot be set */ @Override public void setFile(File outputFile) throws IOException { if (outputFile.getAbsolutePath().endsWith( ArffLoader.FILE_EXTENSION_COMPRESSED)) { setCompressOutput(true); } super.setFile(outputFile); }
/** * Sets the destination file. * * @param outputFile the destination file. * @throws IOException throws an IOException if file cannot be set */ @Override public void setFile(File outputFile) throws IOException { if (outputFile.getAbsolutePath().endsWith( JSONLoader.FILE_EXTENSION_COMPRESSED)) { setCompressOutput(true); } super.setFile(outputFile); }
/** * initializes the sink to save the data to the given file. * * @param filename the file to save data to * @throws Exception if set of saver fails */ public DataSink(String filename) throws Exception { m_Stream = null; if (DataSource.isArff(filename)) { m_Saver = new ArffSaver(); } else { m_Saver = getSaverForFile(filename); } ((AbstractFileSaver) m_Saver).setFile(new File(filename)); }
/** * initializes the sink to save the data to the given file. * * @param filename the file to save data to * @throws Exception if set of saver fails */ public DataSink(String filename) throws Exception { m_Stream = null; if (DataSource.isArff(filename)) { m_Saver = new ArffSaver(); } else { m_Saver = getSaverForFile(filename); } ((AbstractFileSaver) m_Saver).setFile(new File(filename)); }
/** * Saves the data to the specified file. * * @param file the file to save the data to * @param saver the saver to use, determines it automatically if null */ public void save(File file, AbstractFileSaver saver) { if (saver == null) saver = ConverterUtils.getSaverForFile(file); try { saver.setFile(file); saver.writeBatch(); m_CurrentFile = file; } catch (Exception e) { System.err.println("Failed to save data to '" + file + "':"); e.printStackTrace(); JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + e, "Error saving", JOptionPane.ERROR_MESSAGE); } updateMenu(); }
saver = new ArffSaver(); saver.setFile(new File(m_sFile)); saver.setInstances(m_Instances); saver.writeBatch();
saver = new ArffSaver(); saver.setFile(new File(m_sFile)); saver.setInstances(m_Instances); saver.writeBatch();
setFile(output); } catch (Exception ex) { throw new IOException("Cannot create output file (Reason: "
setFile(output); } catch (Exception ex) { throw new IOException("Cannot create output file (Reason: "
/** * Saves the data to the specified file. * * @param file the file to save the data to * @param saver the saver to use, determines it automatically if null */ public void save(File file, AbstractFileSaver saver) { if (saver == null) saver = ConverterUtils.getSaverForFile(file); try { log(null, "Saving: " + file); saver.setInstances(m_Data); if ((saver.retrieveFile() == null) || !saver.retrieveFile().equals(file)) saver.setFile(file); saver.writeBatch(); m_CurrentFile = file; log(null, "Saved successfully: " + file); } catch (Exception e) { handleException(null, "Failed to save data to '" + file + "':", e); JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + e, "Error saving", JOptionPane.ERROR_MESSAGE); } updateMenu(); }
/** * Saves the data to the specified file. * * @param file the file to save the data to * @param saver the saver to use, determines it automatically if null */ public void save(File file, AbstractFileSaver saver) { if (saver == null) saver = ConverterUtils.getSaverForFile(file); try { log(null, "Saving: " + file); saver.setInstances(m_Data); if ((saver.retrieveFile() == null) || !saver.retrieveFile().equals(file)) saver.setFile(file); saver.writeBatch(); m_CurrentFile = file; log(null, "Saved successfully: " + file); } catch (Exception e) { handleException(null, "Failed to save data to '" + file + "':", e); JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + e, "Error saving", JOptionPane.ERROR_MESSAGE); } updateMenu(); }
saver = new ArffSaver(); saver.setFile(new File(predictions)); saver.setInstances(predicted); saver.writeBatch();