Package weka.core.converters

Examples of weka.core.converters.AbstractFileSaver


              a_learn.setEnabled(true);
              a_learnCPT.setEnabled(true);

              m_sFile = jTfFile.getText();
              if (m_sFile != null && !m_sFile.equals("")) {
                AbstractFileSaver saver = ConverterUtils.getSaverForFile(m_sFile);
                // no idea what the format is, so let's save it as ARFF file
                if (saver == null)
                  saver = new ArffSaver();
                saver.setFile(new File(m_sFile));
                saver.setInstances(m_Instances);
                saver.writeBatch();
              }

            } catch (Exception e) {
              e.printStackTrace();
            }
View Full Code Here


   */
  public static void main(String[] args) throws Exception {
    ConverterFileChooser  fc;
    int        retVal;
    AbstractFileLoader    loader;
    AbstractFileSaver    saver;
    Instances      data;
   
    fc     = new ConverterFileChooser();
    retVal = fc.showOpenDialog(null);
   
    // load file
    if (retVal == ConverterFileChooser.APPROVE_OPTION) {
      loader = fc.getLoader();
      data   = loader.getDataSet();
      retVal = fc.showSaveDialog(null);

      // save file
      if (retVal == ConverterFileChooser.APPROVE_OPTION) {
  saver = fc.getSaver();
  saver.setInstances(data);
  saver.writeBatch();
      }
      else {
  System.out.println(Messages.getInstance().getString("ConverterFileChooser_Main_Text_First"));
      }
    }
View Full Code Here

   */
  public static void main(String[] args) throws Exception {
    ConverterFileChooser  fc;
    int        retVal;
    AbstractFileLoader    loader;
    AbstractFileSaver    saver;
    Instances      data;
   
    fc     = new ConverterFileChooser();
    retVal = fc.showOpenDialog(null);
   
    // load file
    if (retVal == ConverterFileChooser.APPROVE_OPTION) {
      loader = fc.getLoader();
      data   = loader.getDataSet();
      retVal = fc.showSaveDialog(null);

      // save file
      if (retVal == ConverterFileChooser.APPROVE_OPTION) {
  saver = fc.getSaver();
  saver.setInstances(data);
  saver.writeBatch();
      }
      else {
  System.out.println("Saving aborted!");
      }
    }
View Full Code Here

   */
  public static void main(String[] args) throws Exception {
    ConverterFileChooser  fc;
    int        retVal;
    AbstractFileLoader    loader;
    AbstractFileSaver    saver;
    Instances      data;
   
    fc     = new ConverterFileChooser();
    retVal = fc.showOpenDialog(null);
   
    // load file
    if (retVal == ConverterFileChooser.APPROVE_OPTION) {
      loader = fc.getLoader();
      data   = loader.getDataSet();
      retVal = fc.showSaveDialog(null);

      // save file
      if (retVal == ConverterFileChooser.APPROVE_OPTION) {
  saver = fc.getSaver();
  saver.setInstances(data);
  saver.writeBatch();
      }
      else {
  System.out.println("Saving aborted!");
      }
    }
View Full Code Here

              a_learn.setEnabled(true);
              a_learnCPT.setEnabled(true);

              m_sFile = jTfFile.getText();
              if (m_sFile != null && !m_sFile.equals("")) {
                AbstractFileSaver saver = ConverterUtils.getSaverForFile(m_sFile);
                // no idea what the format is, so let's save it as ARFF file
                if (saver == null)
                  saver = new ArffSaver();
                saver.setFile(new File(m_sFile));
                saver.setInstances(m_Instances);
                saver.writeBatch();
              }

            } catch (Exception e) {
              e.printStackTrace();
            }
View Full Code Here

TOP

Related Classes of weka.core.converters.AbstractFileSaver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.