Tabnine Logo
SingleClassifierEnhancer
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • findViewById (Activity)
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JCheckBox (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now