/** * Main method for testing this class. * * @param args the options */ public static void main(String[] args) { runEvaluator(new OneRAttributeEval(), args); } }
/** * returns the current setup. * * @return the options of the current setup */ @Override public String[] getOptions() { Vector<String> options = new Vector<String>(); if (getEvalUsingTrainingData()) { options.add("-D"); } options.add("-S"); options.add("" + getSeed()); options.add("-F"); options.add("" + getFolds()); options.add("-B"); options.add("" + getMinimumBucketSize()); return options.toArray(new String[0]); }
/** * Constructor */ public OneRAttributeEval() { resetOptions(); }
setSeed(Integer.parseInt(temp)); setFolds(Integer.parseInt(temp)); setMinimumBucketSize(Integer.parseInt(temp)); setEvalUsingTrainingData(Utils.getFlag('D', options)); Utils.checkForRemainingOptions(options);
/** Creates a default OneRAttributeEval */ public ASEvaluation getEvaluator() { return new OneRAttributeEval(); }
/** * Return a description of the evaluator * * @return description as a string */ @Override public String toString() { StringBuffer text = new StringBuffer(); if (m_trainInstances == null) { text.append("\tOneR feature evaluator has not been built yet"); } else { text.append("\tOneR feature evaluator.\n\n"); text.append("\tUsing "); if (m_evalUsingTrainingData) { text.append("training data for evaluation of attributes."); } else { text.append("" + getFolds() + " fold cross validation for evaluating " + "attributes."); } text .append("\n\tMinimum bucket size for OneR: " + getMinimumBucketSize()); } text.append("\n"); return text.toString(); }
/** * Initializes a OneRAttribute attribute evaluator. Discretizes all attributes * that are numeric. * * @param data set of instances serving as training data * @throws Exception if the evaluator has not been generated successfully */ @Override public void buildEvaluator(Instances data) throws Exception { // can evaluator handle data? getCapabilities().testWithFail(data); m_trainInstances = data; }
trainCopy = Filter.useFilter(trainCopy, delTransform); o_Evaluation = new Evaluation(trainCopy); String[] oneROpts = { "-B", "" + getMinimumBucketSize() }; Classifier oneR = AbstractClassifier.forName("weka.classifiers.rules.OneR", oneROpts);
setSeed(Integer.parseInt(temp)); setFolds(Integer.parseInt(temp)); setMinimumBucketSize(Integer.parseInt(temp)); setEvalUsingTrainingData(Utils.getFlag('D', options)); Utils.checkForRemainingOptions(options);
/** Creates a default OneRAttributeEval */ public ASEvaluation getEvaluator() { return new OneRAttributeEval(); }
/** * Return a description of the evaluator * * @return description as a string */ @Override public String toString() { StringBuffer text = new StringBuffer(); if (m_trainInstances == null) { text.append("\tOneR feature evaluator has not been built yet"); } else { text.append("\tOneR feature evaluator.\n\n"); text.append("\tUsing "); if (m_evalUsingTrainingData) { text.append("training data for evaluation of attributes."); } else { text.append("" + getFolds() + " fold cross validation for evaluating " + "attributes."); } text .append("\n\tMinimum bucket size for OneR: " + getMinimumBucketSize()); } text.append("\n"); return text.toString(); }
/** * Initializes a OneRAttribute attribute evaluator. Discretizes all attributes * that are numeric. * * @param data set of instances serving as training data * @throws Exception if the evaluator has not been generated successfully */ @Override public void buildEvaluator(Instances data) throws Exception { // can evaluator handle data? getCapabilities().testWithFail(data); m_trainInstances = data; }
trainCopy = Filter.useFilter(trainCopy, delTransform); o_Evaluation = new Evaluation(trainCopy); String[] oneROpts = { "-B", "" + getMinimumBucketSize() }; Classifier oneR = AbstractClassifier.forName("weka.classifiers.rules.OneR", oneROpts);
/** * returns the current setup. * * @return the options of the current setup */ @Override public String[] getOptions() { Vector<String> options = new Vector<String>(); if (getEvalUsingTrainingData()) { options.add("-D"); } options.add("-S"); options.add("" + getSeed()); options.add("-F"); options.add("" + getFolds()); options.add("-B"); options.add("" + getMinimumBucketSize()); return options.toArray(new String[0]); }
/** * Main method for testing this class. * * @param args the options */ public static void main(String[] args) { runEvaluator(new OneRAttributeEval(), args); } }
/** * Constructor */ public OneRAttributeEval() { resetOptions(); }