Package weka.experiment

Examples of weka.experiment.Experiment


    * @return the processed object
    * @throws Exception if post-processing fails
    */
   protected Object readPostProcess(Object o) throws Exception {
      Element              node;
      Experiment           exp;
      int                  i;
      Vector               children;

      exp = (Experiment) o;
     
      // classfirst
      children = XMLDocument.getChildTags(m_Document.getDocument().getDocumentElement());
      for (i = 0; i < children.size(); i++) {
         node = (Element) children.get(i);
         if (node.getAttribute(ATT_NAME).equals(NAME_CLASSFIRST)) {
            exp.classFirst(new Boolean(XMLDocument.getContent(node)).booleanValue());
            break;
         }
      }
     
      return o;
View Full Code Here


   */
  public static void main(String [] args) {
    try {
      final JFrame jf = new JFrame("DistributeExperiment");
      jf.getContentPane().setLayout(new BorderLayout());
      jf.getContentPane().add(new DistributeExperimentPanel(new Experiment()),
            BorderLayout.CENTER);
      jf.addWindowListener(new WindowAdapter() {
  public void windowClosing(WindowEvent e) {
    jf.dispose();
    System.exit(0);
View Full Code Here

      boolean readExp = Utils.getFlag('l', args);
      final String expFile = Utils.getOption('f', args);
      if (readExp && (expFile.length() == 0)) {
  throw new Exception("A filename must be given with the -f option");
      }
      Experiment exp = null;
      if (readExp) {
  FileInputStream fi = new FileInputStream(expFile);
  ObjectInputStream oi = new ObjectInputStream(
             new BufferedInputStream(fi));
  Object to = oi.readObject();
  if (to instanceof RemoteExperiment) {
    exp = (RemoteExperiment)to;
  } else {
    exp = (Experiment)to;
  }
  oi.close();
      } else {
  exp = new Experiment();
      }
      System.err.println("Initial Experiment:\n" + exp.toString());
      final JFrame jf = new JFrame("Run Weka Experiment");
      jf.getContentPane().setLayout(new BorderLayout());
      final RunPanel sp = new RunPanel(exp);
      //sp.setBorder(BorderFactory.createTitledBorder("Setup"));
      jf.getContentPane().add(sp, BorderLayout.CENTER);
View Full Code Here

      jf.pack();
      jf.setVisible(true);
      System.err.println("Short nap");
      Thread.currentThread().sleep(3000);
      System.err.println("Done");
      dp.setExperiment(new Experiment());
    } catch (Exception ex) {
      ex.printStackTrace();
      System.err.println(ex.getMessage());
    }
  }
View Full Code Here

    // create action listeners
    m_NewBut.setMnemonic('N');
    m_NewBut.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    Experiment newExp = new Experiment();
    CrossValidationResultProducer cvrp = new CrossValidationResultProducer();
    cvrp.setNumFolds(10);
    cvrp.setSplitEvaluator(new ClassifierSplitEvaluator());
    newExp.setResultProducer(cvrp);
    newExp.setPropertyArray(new Classifier[0]);
    newExp.setUsePropertyIterator(true);
    setExperiment(newExp);

          // defaults
          if (ExperimenterDefaults.getUseClassification())
            m_ExpClassificationRBut.setSelected(true);
View Full Code Here

      if (!expFile.getName().toLowerCase().endsWith(".xml"))
        expFile = new File(expFile.getParent(), expFile.getName() + ".xml");
    }
   
    try {
      Experiment exp;
     
      // KOML?
      if ( (KOML.isPresent()) && (expFile.getAbsolutePath().toLowerCase().endsWith(KOML.FILE_EXTENSION)) ) {
         exp = (Experiment) KOML.read(expFile.getAbsolutePath());
      }
View Full Code Here

      jf.pack();
      jf.setVisible(true);
      System.err.println("Short nap");
      Thread.currentThread().sleep(3000);
      System.err.println("Done");
      dp.setExperiment(new Experiment());
    } catch (Exception ex) {
      ex.printStackTrace();
      System.err.println(ex.getMessage());
    }
  }
View Full Code Here

  });       

    m_NewBut.setMnemonic('N');
    m_NewBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
  setExperiment(new Experiment());
      }
    });
    m_SaveBut.setMnemonic('S');
    m_SaveBut.setEnabled(false);
    m_SaveBut.addActionListener(new ActionListener() {
View Full Code Here

      if (!expFile.getName().toLowerCase().endsWith(".xml"))
        expFile = new File(expFile.getParent(), expFile.getName() + ".xml");
    }
   
    try {
      Experiment exp = Experiment.read(expFile.getAbsolutePath());
      setExperiment(exp);
      System.err.println("Opened experiment:\n" + m_Exp);
    } catch (Exception ex) {
      ex.printStackTrace();
      JOptionPane.showMessageDialog(this, "Couldn't open experiment file:\n"
View Full Code Here

      final boolean writeExp = Utils.getFlag('s', args);
      final String expFile = Utils.getOption('f', args);
      if ((readExp || writeExp) && (expFile.length() == 0)) {
  throw new Exception("A filename must be given with the -f option");
      }
      Experiment exp = null;
      if (readExp) {
  FileInputStream fi = new FileInputStream(expFile);
  ObjectInputStream oi = new ObjectInputStream(
             new BufferedInputStream(fi));
  exp = (Experiment)oi.readObject();
  oi.close();
      } else {
  exp = new Experiment();
      }
      System.err.println("Initial Experiment:\n" + exp.toString());
      final JFrame jf = new JFrame("Weka Experiment Setup");
      jf.getContentPane().setLayout(new BorderLayout());
      final SetupPanel sp = new SetupPanel();
      //sp.setBorder(BorderFactory.createTitledBorder("Setup"));
      jf.getContentPane().add(sp, BorderLayout.CENTER);
View Full Code Here

TOP

Related Classes of weka.experiment.Experiment

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.