Java Code Examples for weka.core.Utils#toCommandLine()

The following examples show how to use weka.core.Utils#toCommandLine() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KeyValuePairs.java    From meka with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Checks whether the specified combination of classifier and dataset is required for evaluation
 * or already present from previous evaluation.
 *
 * @param classifier    the classifier to check
 * @param dataset       the dataset to check
 * @return              true if it needs evaluating
 */
public boolean requires(MultiLabelClassifier classifier, Instances dataset) {
	boolean     result;
	String      cls;
	String      rel;

	result = true;

	cls = Utils.toCommandLine(classifier);
	rel = dataset.relationName();

	for (EvaluationStatistics stat: m_Statistics) {
		if (stat.getCommandLine().equals(cls) && stat.getRelation().equals(rel)) {
			result = false;
			break;
		}
	}

	return result;
}
 
Example 2
Source File: KeyValuePairs.java    From meka with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Retrieves the statis for the specified combination of classifier and dataset.
 *
 * @param classifier    the classifier to check
 * @param dataset       the dataset to check
 * @return              the stats, null if not available
 */
public List<EvaluationStatistics> retrieve(MultiLabelClassifier classifier, Instances dataset) {
	List<EvaluationStatistics>  result;
	String                      cls;
	String                      rel;

	result = new ArrayList<>();

	cls = Utils.toCommandLine(classifier);
	rel = dataset.relationName();

	for (EvaluationStatistics stat: m_Statistics) {
		if (stat.getCommandLine().equals(cls) && stat.getRelation().equals(rel))
			result.add(stat);
	}

	return result;
}
 
Example 3
Source File: CopyModelSetup.java    From meka with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the action lister to use in the menu.
 *
 * @param history   the current history
 * @param index     the selected history item
 * @return          the listener
 */
@Override
public ActionListener getActionListener(final ResultHistoryList history, final int index) {
	return new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			String cmdline = Utils.toCommandLine(getClassifier(history, index));
			GUIHelper.copyToClipboard(cmdline);
		}
	};
}
 
Example 4
Source File: RecentFilesHandlerWithCommandline.java    From meka with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the container setup as string.
 *
 * @return		the string
 */
@Override
public String toString() {
	if (m_Handler != null)
		return m_File.getAbsolutePath() + "\t" + Utils.toCommandLine(m_Handler);
	else
		return m_File.getAbsolutePath() + "\t";
}
 
Example 5
Source File: OptionUtils.java    From meka with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the commandline string for the object.
 *
 * @param obj           the object to generate the commandline for
 * @return              the commandline
 * @see                 Utils#toCommandLine(Object)
 */
public static String toCommandLine(Object obj) {
	return Utils.toCommandLine(obj);
}