All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weka.classifiers.CheckSource Maven / Gradle / Ivy

Go to download

The Waikato Environment for Knowledge Analysis (WEKA), a machine learning workbench. This is the stable version. Apart from bugfixes, this version does not receive any other updates.

There is a newer version: 3.8.6
Show newest version
/*
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see .
 */

/*
 * CheckSource.java
 * Copyright (C) 2007-2012 University of Waikato, Hamilton, New Zealand
 */

package weka.classifiers;

import java.io.File;
import java.util.Enumeration;
import java.util.Vector;

import weka.core.Instances;
import weka.core.Option;
import weka.core.OptionHandler;
import weka.core.RevisionHandler;
import weka.core.RevisionUtils;
import weka.core.Utils;
import weka.core.converters.ConverterUtils.DataSource;

/**
 * A simple class for checking the source generated from Classifiers
 * implementing the weka.classifiers.Sourcable interface.
 * It takes a classifier, the classname of the generated source
 * and the dataset the source was generated with as parameters and tests
 * the output of the built classifier against the output of the generated
 * source. Use option '-h' to display all available commandline options.
 *
 
 * Valid options are: 

* *

 -W <classname and options>
 *  The classifier (incl. options) that was used to generate
 *  the source code.
* *
 -S <classname>
 *  The classname of the generated source code.
* *
 -t <file>
 *  The training set with which the source code was generated.
* *
 -c <index>
 *  The class index of the training set. 'first' and 'last' are
 *  valid indices.
 *  (default: last)
* * * Options after -- are passed to the designated classifier (specified with -W). * * @author fracpete (fracpete at waikato dot ac dot nz) * @version $Revision: 10141 $ * @see weka.classifiers.Sourcable */ public class CheckSource implements OptionHandler, RevisionHandler { /** the classifier used for generating the source code */ protected Classifier m_Classifier = null; /** the generated source code */ protected Classifier m_SourceCode = null; /** the dataset to use for testing */ protected File m_Dataset = null; /** the class index */ protected int m_ClassIndex = -1; /** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ public Enumeration




© 2015 - 2024 Weber Informatics LLC | Privacy Policy