Codota Logo
SingleClassifierEnhancer
Code IndexAdd Codota to your IDE (free)

How to use
SingleClassifierEnhancer
in
weka.classifiers

Best Java code snippets using weka.classifiers.SingleClassifierEnhancer (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns default capabilities of the classifier.
 * 
 * @return the capabilities of this classifier
 */
@Override
public Capabilities getCapabilities() {
 Capabilities result = super.getCapabilities();
 result.disable(Capability.RELATIONAL_ATTRIBUTES);
 return result;
}
origin: nz.ac.waikato.cms.weka/multiInstanceLearning

/**
 * Gets the current settings of the Classifier.
 * 
 * @return an array of strings suitable for passing to setOptions
 */
@Override
public String[] getOptions() {
 Vector<String> result = new Vector<String>();
 result.add("-M");
 result.add("" + m_TransformMethod);
 Collections.addAll(result, super.getOptions());
 return result.toArray(new String[result.size()]);
}
origin: nz.ac.waikato.cms.weka/distributedWekaBase

@Override
public Enumeration<Option> listOptions() {
 Vector<Option> options = new Vector<Option>();
 options.add(new Option("\tPath to pre-constructed filter to use.",
  "load-filter", 1,
  "-load-filter <path to serialized pre-constructed filter>"));
 Enumeration superOpts = super.listOptions();
 while (superOpts.hasMoreElements()) {
  options.add((Option) superOpts.nextElement());
 }
 return options.elements();
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Parses a given list of options. Valid options are:<p>
 *
 * -W classname <br>
 * Specify the full class name of the base learner.<p>
 *
 * Options after -- are passed to the designated classifier.<p>
 *
 * @param options the list of options as an array of strings
 * @exception Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
 super.setOptions(options);
 String classifierName = Utils.getOption('W', options);
 if (classifierName.length() > 0) {
  setClassifier(AbstractClassifier.forName(classifierName, null));
  setClassifier(AbstractClassifier.forName(classifierName,
     Utils.partitionOptions(options)));
 } else {
  setClassifier(AbstractClassifier.forName(defaultClassifierString(), null));
  String[] classifierOptions = Utils.partitionOptions(options);
  if (classifierOptions.length > 0) {
   setClassifier(AbstractClassifier.forName(defaultClassifierString(),
                        classifierOptions));
  } else {
   setClassifier(AbstractClassifier.forName(defaultClassifierString(),
                        defaultClassifierOptions()));
  }
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns an enumeration describing the available options.
 *
 * @return an enumeration of all the available options.
 */
public Enumeration<Option> listOptions() {
 Vector<Option> newVector = new Vector<Option>(3);
 newVector.addElement(new Option(
    "\tFull name of base classifier.\n"
    + "\t(default: " + defaultClassifierString() + 
    ((defaultClassifierOptions().length > 0) ? 
     " with options " + Utils.joinOptions(defaultClassifierOptions()) + ")" : ")"),
    "W", 1, "-W <classifier name>"));
 
 newVector.addAll(Collections.list(super.listOptions()));
 newVector.addElement(new Option(
    "",
    "", 0, "\nOptions specific to classifier "
    + m_Classifier.getClass().getName() + ":"));
 newVector.addAll(Collections.list(((OptionHandler)m_Classifier).listOptions()));
 return newVector.elements();
}
origin: nz.ac.waikato.cms.weka/distributedWekaBase

@Override
public void setOptions(String[] options) throws Exception {
 setPathToPreConstructedFilter(Utils.getOption("load-filter", options));
 super.setOptions(options);
}
origin: nz.ac.waikato.cms.weka/weka-stable

 @Override
 public void postExecution() throws Exception {
  if (getClassifier() instanceof CommandlineRunnable) {
   ((CommandlineRunnable) getClassifier()).postExecution();
  }
 }
}
origin: Waikato/meka

@Override
public void setClassifier(Classifier newClassifier) {
if (newClassifier instanceof MultiLabelClassifier)
  super.setClassifier(newClassifier);
else
  System.err.println(
        "Base classifier must implement " + MultiLabelClassifier.class.getName()
        + ", provided: " + newClassifier.getClass().getName());
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns true if the base classifier implements BatchPredictor and is able
 * to generate batch predictions efficiently
 *
 * @return true if the base classifier can generate batch predictions
 *         efficiently
 */
public boolean implementsMoreEfficientBatchPrediction() {
 if (!(getClassifier() instanceof BatchPredictor)) {
  return super.implementsMoreEfficientBatchPrediction();
 }
 return ((BatchPredictor) getClassifier()).implementsMoreEfficientBatchPrediction();
}
origin: Waikato/weka-trunk

/**
 * Gets the preferred batch size from the base learner if it implements
 * BatchPredictor. Returns 1 as the preferred batch size otherwise.
 *
 * @return the batch size to use
 */
public String getBatchSize() {
 if (getClassifier() instanceof BatchPredictor) {
  return ((BatchPredictor) getClassifier()).getBatchSize();
 } else {
  return super.getBatchSize();
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Parses a given list of options. Valid options are:<p>
 *
 * -W classname <br>
 * Specify the full class name of the base learner.<p>
 *
 * -I num <br>
 * Set the number of iterations (default 10). <p>
 *
 * -S num <br>
 * Set the random number seed (default 1). <p>
 *
 * Options after -- are passed to the designated classifier.<p>
 *
 * @param options the list of options as an array of strings
 * @exception Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
 String seed = Utils.getOption('S', options);
 if (seed.length() != 0) {
  setSeed(Integer.parseInt(seed));
 } else {
  setSeed(1);
 }
 super.setOptions(options);
}
origin: Waikato/weka-trunk

/**
 * Parses a given list of options. Valid options are:<p>
 *
 * -W classname <br>
 * Specify the full class name of the base learner.<p>
 *
 * Options after -- are passed to the designated classifier.<p>
 *
 * @param options the list of options as an array of strings
 * @exception Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
 super.setOptions(options);
 String classifierName = Utils.getOption('W', options);
 if (classifierName.length() > 0) {
  setClassifier(AbstractClassifier.forName(classifierName, null));
  setClassifier(AbstractClassifier.forName(classifierName,
     Utils.partitionOptions(options)));
 } else {
  setClassifier(AbstractClassifier.forName(defaultClassifierString(), null));
  String[] classifierOptions = Utils.partitionOptions(options);
  if (classifierOptions.length > 0) {
   setClassifier(AbstractClassifier.forName(defaultClassifierString(),
                        classifierOptions));
  } else {
   setClassifier(AbstractClassifier.forName(defaultClassifierString(),
                        defaultClassifierOptions()));
  }
 }
}
origin: Waikato/weka-trunk

@Override
public void preExecution() throws Exception {
 if (getClassifier() instanceof CommandlineRunnable) {
  ((CommandlineRunnable) getClassifier()).preExecution();
 }
}
origin: Waikato/weka-trunk

/**
 * Returns an enumeration describing the available options.
 *
 * @return an enumeration of all the available options.
 */
public Enumeration<Option> listOptions() {
 Vector<Option> newVector = new Vector<Option>(3);
 newVector.addElement(new Option(
    "\tFull name of base classifier.\n"
    + "\t(default: " + defaultClassifierString() + 
    ((defaultClassifierOptions().length > 0) ? 
     " with options " + Utils.joinOptions(defaultClassifierOptions()) + ")" : ")"),
    "W", 1, "-W <classifier name>"));
 
 newVector.addAll(Collections.list(super.listOptions()));
 newVector.addElement(new Option(
    "",
    "", 0, "\nOptions specific to classifier "
    + m_Classifier.getClass().getName() + ":"));
 newVector.addAll(Collections.list(((OptionHandler)m_Classifier).listOptions()));
 return newVector.elements();
}
origin: net.sf.meka/meka

@Override
public void setClassifier(Classifier newClassifier) {
if (newClassifier instanceof MultiLabelClassifier)
  super.setClassifier(newClassifier);
else
  System.err.println(
        "Base classifier must implement " + MultiLabelClassifier.class.getName()
        + ", provided: " + newClassifier.getClass().getName());
}
origin: Waikato/weka-trunk

/**
 * Returns true if the base classifier implements BatchPredictor and is able
 * to generate batch predictions efficiently
 *
 * @return true if the base classifier can generate batch predictions
 *         efficiently
 */
public boolean implementsMoreEfficientBatchPrediction() {
 if (!(getClassifier() instanceof BatchPredictor)) {
  return super.implementsMoreEfficientBatchPrediction();
 }
 return ((BatchPredictor) getClassifier()).implementsMoreEfficientBatchPrediction();
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Gets the preferred batch size from the base learner if it implements
 * BatchPredictor. Returns 1 as the preferred batch size otherwise.
 *
 * @return the batch size to use
 */
public String getBatchSize() {
 if (getClassifier() instanceof BatchPredictor) {
  return ((BatchPredictor) getClassifier()).getBatchSize();
 } else {
  return super.getBatchSize();
 }
}
origin: Waikato/weka-trunk

/**
 * Returns default capabilities of the classifier.
 * 
 * @return the capabilities of this classifier
 */
@Override
public Capabilities getCapabilities() {
 Capabilities result = super.getCapabilities();
 result.disable(Capability.RELATIONAL_ATTRIBUTES);
 return result;
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * 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>();
 
 options.add("-S");
 options.add("" + getSeed());
 Collections.addAll(options, super.getOptions());
 
 return options.toArray(new String[0]);
}
origin: Waikato/weka-trunk

/**
 * Parses a given list of options. Valid options are:<p>
 *
 * -W classname <br>
 * Specify the full class name of the base learner.<p>
 *
 * -I num <br>
 * Set the number of iterations (default 10). <p>
 *
 * -S num <br>
 * Set the random number seed (default 1). <p>
 *
 * Options after -- are passed to the designated classifier.<p>
 *
 * @param options the list of options as an array of strings
 * @exception Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
 String seed = Utils.getOption('S', options);
 if (seed.length() != 0) {
  setSeed(Integer.parseInt(seed));
 } else {
  setSeed(1);
 }
 super.setOptions(options);
}
weka.classifiersSingleClassifierEnhancer

Javadoc

Abstract utility class for handling settings common to meta classifiers that use a single base learner.

Most used methods

  • getCapabilities
    Returns default capabilities of the base classifier.
  • getOptions
    Gets the current settings of the Classifier.
  • listOptions
    Returns an enumeration describing the available options.
  • setOptions
    Parses a given list of options. Valid options are: -W classname Specify the full class name of the
  • setClassifier
    Set the base learner.
  • defaultClassifierOptions
    String describing options for default classifier.
  • defaultClassifierString
    String describing default classifier.
  • getBatchSize
  • getClassifier
    Get the classifier used as the base learner.
  • implementsMoreEfficientBatchPrediction
  • setBatchSize
  • distributionsForInstances
  • setBatchSize,
  • distributionsForInstances

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • addToBackStack (FragmentTransaction)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now