/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ public String [] getOptions() { Vector<String> options = new Vector<String>(); if (m_MatrixSource == MATRIX_SUPPLIED) { if (m_CostFile != null) { options.add("-C"); options.add("" + m_CostFile); } else { options.add("-cost-matrix"); options.add(getCostMatrix().toMatlab()); } } else { options.add("-N"); options.add("" + getOnDemandDirectory()); } if (getMinimizeExpectedCost()) { options.add("-M"); } Collections.addAll(options, super.getOptions()); return options.toArray(new String[0]); }
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ public String [] getOptions() { Vector<String> options = new Vector<String>(); if (m_MatrixSource == MATRIX_SUPPLIED) { if (m_CostFile != null) { options.add("-C"); options.add("" + m_CostFile); } else { options.add("-cost-matrix"); options.add(getCostMatrix().toMatlab()); } } else { options.add("-N"); options.add("" + getOnDemandDirectory()); } if (getMinimizeExpectedCost()) { options.add("-M"); } Collections.addAll(options, super.getOptions()); return options.toArray(new String[0]); }
/** * Called when the OK button is pressed */ @Override protected void okPressed() { StringBuilder b = new StringBuilder(); for (String s : m_evaluationMetrics) { b.append(s).append(","); } String newList = b.substring(0, b.length() - 1); ((ClassifierPerformanceEvaluator) getStepToEdit()) .setEvaluationMetricsToOutput(newList); ((ClassifierPerformanceEvaluator) getStepToEdit()) .setEvaluateWithRespectToCosts(m_useCosts.isSelected()); if (m_useCosts.isSelected()) { CostMatrix m = (CostMatrix) m_CostMatrixEditor.getValue(); ((ClassifierPerformanceEvaluator) getStepToEdit()).setCostMatrixString(m .toMatlab()); } } }
/** * Called when the OK button is pressed */ @Override protected void okPressed() { StringBuilder b = new StringBuilder(); for (String s : m_evaluationMetrics) { b.append(s).append(","); } String newList = b.substring(0, b.length() - 1); ((ClassifierPerformanceEvaluator) getStepToEdit()) .setEvaluationMetricsToOutput(newList); ((ClassifierPerformanceEvaluator) getStepToEdit()) .setEvaluateWithRespectToCosts(m_useCosts.isSelected()); if (m_useCosts.isSelected()) { CostMatrix m = (CostMatrix) m_CostMatrixEditor.getValue(); ((ClassifierPerformanceEvaluator) getStepToEdit()).setCostMatrixString(m .toMatlab()); } } }