Package weka.experiment

Examples of weka.experiment.SplitEvaluator


      m_NumberOfRepetitionsTField.setEnabled(true);
      m_Exp.setRunLower(1);
      m_Exp.setRunUpper(m_numRepetitions);
    }

    SplitEvaluator se = null;
    Classifier sec = null;
    if (m_ExpClassificationRBut.isSelected()) {
      se = new ClassifierSplitEvaluator();
      sec = ((ClassifierSplitEvaluator)se).getClassifier();
    } else {
      se = new RegressionSplitEvaluator();
      sec = ((RegressionSplitEvaluator)se).getClassifier();
    }
   
    // build new ResultProducer
    if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) {
      CrossValidationResultProducer cvrp = new CrossValidationResultProducer();
      cvrp.setNumFolds(m_numFolds);
      cvrp.setSplitEvaluator(se);
     
      PropertyNode[] propertyPath = new PropertyNode[2];
      try {
  propertyPath[0] = new PropertyNode(se, new PropertyDescriptor("splitEvaluator",
                      CrossValidationResultProducer.class),
             CrossValidationResultProducer.class);
  propertyPath[1] = new PropertyNode(sec, new PropertyDescriptor("classifier",
                       se.getClass()),
             se.getClass());
      } catch (IntrospectionException e) {
  e.printStackTrace();
      }
     
      m_Exp.setResultProducer(cvrp);
      m_Exp.setPropertyPath(propertyPath);

    } else {
      RandomSplitResultProducer rsrp = new RandomSplitResultProducer();
      rsrp.setRandomizeData(m_ExperimentTypeCBox.getSelectedItem() == TYPE_RANDOMSPLIT_TEXT);
      rsrp.setTrainPercent(m_trainPercent);
      rsrp.setSplitEvaluator(se);

      PropertyNode[] propertyPath = new PropertyNode[2];
      try {
  propertyPath[0] = new PropertyNode(se, new PropertyDescriptor("splitEvaluator",
                      RandomSplitResultProducer.class),
             RandomSplitResultProducer.class);
  propertyPath[1] = new PropertyNode(sec, new PropertyDescriptor("classifier",
                       se.getClass()),
             se.getClass());
      } catch (IntrospectionException e) {
  e.printStackTrace();
      }

      m_Exp.setResultProducer(rsrp);
View Full Code Here


      m_NumberOfRepetitionsTField.setEnabled(true);
      m_Exp.setRunLower(1);
      m_Exp.setRunUpper(m_numRepetitions);
    }

    SplitEvaluator se = null;
    Classifier sec = null;
    if (m_ExpClassificationRBut.isSelected()) {
      se = new ClassifierSplitEvaluator();
      sec = ((ClassifierSplitEvaluator)se).getClassifier();
    } else {
      se = new RegressionSplitEvaluator();
      sec = ((RegressionSplitEvaluator)se).getClassifier();
    }
   
    // build new ResultProducer
    if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) {
      CrossValidationResultProducer cvrp = new CrossValidationResultProducer();
      cvrp.setNumFolds(m_numFolds);
      cvrp.setSplitEvaluator(se);
     
      PropertyNode[] propertyPath = new PropertyNode[2];
      try {
  propertyPath[0] = new PropertyNode(se, new PropertyDescriptor("splitEvaluator",
                      CrossValidationResultProducer.class),
             CrossValidationResultProducer.class);
  propertyPath[1] = new PropertyNode(sec, new PropertyDescriptor("classifier",
                       se.getClass()),
             se.getClass());
      } catch (IntrospectionException e) {
  e.printStackTrace();
      }
     
      m_Exp.setResultProducer(cvrp);
      m_Exp.setPropertyPath(propertyPath);

    } else {
      RandomSplitResultProducer rsrp = new RandomSplitResultProducer();
      rsrp.setRandomizeData(m_ExperimentTypeCBox.getSelectedItem() == TYPE_RANDOMSPLIT_TEXT);
      rsrp.setTrainPercent(m_trainPercent);
      rsrp.setSplitEvaluator(se);

      PropertyNode[] propertyPath = new PropertyNode[2];
      try {
  propertyPath[0] = new PropertyNode(se, new PropertyDescriptor("splitEvaluator",
                      RandomSplitResultProducer.class),
             RandomSplitResultProducer.class);
  propertyPath[1] = new PropertyNode(sec, new PropertyDescriptor("classifier",
                       se.getClass()),
             se.getClass());
      } catch (IntrospectionException e) {
  e.printStackTrace();
      }

      m_Exp.setResultProducer(rsrp);
View Full Code Here

      m_NumberOfRepetitionsTField.setEnabled(true);
      m_Exp.setRunLower(1);
      m_Exp.setRunUpper(m_numRepetitions);
    }

    SplitEvaluator se = null;
    Classifier sec = null;
    if (m_ExpClassificationRBut.isSelected()) {
      se = new ClassifierSplitEvaluator();
      sec = ((ClassifierSplitEvaluator)se).getClassifier();
    } else {
      se = new RegressionSplitEvaluator();
      sec = ((RegressionSplitEvaluator)se).getClassifier();
    }
   
    // build new ResultProducer
    if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) {
      CrossValidationResultProducer cvrp = new CrossValidationResultProducer();
      cvrp.setNumFolds(m_numFolds);
      cvrp.setSplitEvaluator(se);
     
      PropertyNode[] propertyPath = new PropertyNode[2];
      try {
  propertyPath[0] = new PropertyNode(se, new PropertyDescriptor("splitEvaluator",
                      CrossValidationResultProducer.class),
             CrossValidationResultProducer.class);
  propertyPath[1] = new PropertyNode(sec, new PropertyDescriptor("classifier",
                       se.getClass()),
             se.getClass());
      } catch (IntrospectionException e) {
  e.printStackTrace();
      }
     
      m_Exp.setResultProducer(cvrp);
      m_Exp.setPropertyPath(propertyPath);

    } else {
      RandomSplitResultProducer rsrp = new RandomSplitResultProducer();
      rsrp.setRandomizeData(m_ExperimentTypeCBox.getSelectedItem() == TYPE_RANDOMSPLIT_TEXT);
      rsrp.setTrainPercent(m_trainPercent);
      rsrp.setSplitEvaluator(se);

      PropertyNode[] propertyPath = new PropertyNode[2];
      try {
  propertyPath[0] = new PropertyNode(se, new PropertyDescriptor("splitEvaluator",
                      RandomSplitResultProducer.class),
             RandomSplitResultProducer.class);
  propertyPath[1] = new PropertyNode(sec, new PropertyDescriptor("classifier",
                       se.getClass()),
             se.getClass());
      } catch (IntrospectionException e) {
  e.printStackTrace();
      }

      m_Exp.setResultProducer(rsrp);
View Full Code Here

TOP

Related Classes of weka.experiment.SplitEvaluator

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.