Java Code Examples for weka.core.Capabilities#disable()

The following examples show how to use weka.core.Capabilities#disable() . 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: SVMAttributeEval.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns the capabilities of this evaluator.
 *
 * @return            the capabilities of this evaluator
 * @see               Capabilities
 */
public Capabilities getCapabilities() {
  Capabilities        result;
  
  result = new SMO().getCapabilities();
  
  result.setOwner(this);
  
  // only binary attributes are allowed, otherwise the NominalToBinary
  // filter inside SMO will increase the number of attributes which in turn
  // will lead to ArrayIndexOutOfBounds-Exceptions.
  result.disable(Capability.NOMINAL_ATTRIBUTES);
  result.enable(Capability.BINARY_ATTRIBUTES);
  result.disableAllAttributeDependencies();
  
  return result;
}
 
Example 2
Source File: FilteredClassifier.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns default capabilities of the classifier.
 *
 * @return      the capabilities of this classifier
 */
public Capabilities getCapabilities() {
  Capabilities	result;
  
  if (getFilter() == null)
    result = super.getCapabilities();
  else
    result = getFilter().getCapabilities();
  
  // the filtered classifier always needs a class
  result.disable(Capability.NO_CLASS);
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 3
Source File: MultiInstanceToPropositional.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns the capabilities of this multi-instance filter for the
 * relational data (i.e., the bags).
 *
 * @return            the capabilities of this object
 * @see               Capabilities
 */
public Capabilities getMultiInstanceCapabilities() {
  Capabilities result = new Capabilities(this);

  // attributes
  result.enableAllAttributes();
  result.disable(Capability.RELATIONAL_ATTRIBUTES);
  result.enable(Capability.MISSING_VALUES);
  
  // class
  result.enableAllClasses();
  result.enable(Capability.MISSING_CLASS_VALUES);
  result.enable(Capability.NO_CLASS);
  
  // other
  result.setMinimumNumberInstances(0);
  
  return result;
}
 
Example 4
Source File: YATSI.java    From collective-classification-weka-package with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns default capabilities of the classifier.
 *
 * @return      the capabilities of this classifier
 */
@Override
public Capabilities getCapabilities() {
  Capabilities result = super.getCapabilities();

  // class
  result.disableAllClasses();
  result.disableAllClassDependencies();
  Capabilities cls = getClassifier().getCapabilities();
  if (cls.handles(Capability.NOMINAL_CLASS))
    result.enable(Capability.NOMINAL_CLASS);
  else if (cls.handles(Capability.BINARY_CLASS))
    result.enable(Capability.BINARY_CLASS);
  else if (cls.handles(Capability.UNARY_CLASS))
    result.enable(Capability.UNARY_CLASS);
  result.disable(Capability.MISSING_CLASS_VALUES);
  
  return result;
}
 
Example 5
Source File: MultivariateAbstractClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Capabilities getCapabilities() {
    Capabilities result = super.getCapabilities();
    result.enable(Capabilities.Capability.RELATIONAL_ATTRIBUTES);
    result.disable(Capabilities.Capability.MISSING_VALUES);
    return result;
}
 
Example 6
Source File: WrapperSubsetEval.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the capabilities of this evaluator.
 *
 * @return            the capabilities of this evaluator
 * @see               Capabilities
 */
public Capabilities getCapabilities() {
  Capabilities	result;
  
  if (getClassifier() == null) {
    result = super.getCapabilities();
    result.disableAll();
  } else {
    result = getClassifier().getCapabilities();
  }
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  // adjustment for class based on selected evaluation metric
  result.disable(Capability.NUMERIC_CLASS);
  result.disable(Capability.DATE_CLASS);
  if (m_evaluationMeasure != EVAL_ACCURACY && m_evaluationMeasure != EVAL_FMEASURE &&
      m_evaluationMeasure != EVAL_AUC && m_evaluationMeasure != EVAL_AUPRC) {
    result.enable(Capability.NUMERIC_CLASS);
    result.enable(Capability.DATE_CLASS);
  }
  
  result.setMinimumNumberInstances(getFolds());
  
  return result;
}
 
Example 7
Source File: ClassificationViaClustering.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns default capabilities of the classifier.
 *
 * @return		the capabilities of this classifier
 */
public Capabilities getCapabilities() {
  Capabilities	result;
  
  result = m_Clusterer.getCapabilities();
  
  // class
  result.disableAllClasses();
  result.disable(Capability.NO_CLASS);
  result.enable(Capability.NOMINAL_CLASS);
  
  return result;
}
 
Example 8
Source File: InputMappedClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns default capabilities of the classifier.
 *
 * @return      the capabilities of this classifier
 */
public Capabilities getCapabilities() {
  Capabilities result = super.getCapabilities();
  
  result.disable(Capability.RELATIONAL_ATTRIBUTES);
  
  return result;
}
 
Example 9
Source File: DTNB.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns default capabilities of the classifier.
 *
 * @return      the capabilities of this classifier
 */
public Capabilities getCapabilities() {
  Capabilities result = super.getCapabilities();

  result.disable(Capability.NUMERIC_CLASS);
  result.disable(Capability.DATE_CLASS);

  return result;
}