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

The following examples show how to use weka.core.Capabilities#enableDependency() . 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: FilteredClusterer.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns default capabilities of the clusterer.
 *
 * @return		the capabilities of this clusterer
 */
public Capabilities getCapabilities() {
  Capabilities	result;
  
  if (getFilter() == null) {
    result = super.getCapabilities();
    result.disableAll();
    result.enable(Capability.NO_CLASS);
  } else {
    result = getFilter().getCapabilities();
  }
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 2
Source File: FilteredAssociator.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns default capabilities of the associator.
 *
 * @return      the capabilities of this associator
 */
public Capabilities getCapabilities() {
  Capabilities	result;
  
  if (getFilter() == null) {
    result = super.getCapabilities();
    result.disableAll();
  } else {
    result = getFilter().getCapabilities();
  }
  
  result.enable(Capability.NO_CLASS);
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 3
Source File: FilteredAttributeEval.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns default capabilities of the evaluator.
 *
 * @return      the capabilities of this evaluator.
 */
public Capabilities getCapabilities() {
  Capabilities result;

  if (getFilter() == null) {
    result = super.getCapabilities();
    result.disableAll();
  } else {
    result = getFilter().getCapabilities();
  }
  
  // set dependencies
  for (Capability cap: Capability.values()) {
    result.enableDependency(cap);
  }
  
  return result;
}
 
Example 4
Source File: ClassifierSubsetEval.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;
  
  if (getClassifier() == null) {
    result = super.getCapabilities();
    result.disableAll();
  } else {
    result = getClassifier().getCapabilities();
  }
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 5
Source File: FilteredSubsetEval.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns default capabilities of the evaluator.
 *
 * @return      the capabilities of this evaluator.
 */
public Capabilities getCapabilities() {
  Capabilities result;

  if (getFilter() == null) {
    result = super.getCapabilities();
    result.disableAll();
  } else {
    result = getFilter().getCapabilities();
  }
  
  // set dependencies
  for (Capability cap: Capability.values()) {
    result.enableDependency(cap);
  } 
  
  return result; 
}
 
Example 6
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 7
Source File: LWL.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 (m_Classifier != null) {
    result = m_Classifier.getCapabilities();
  } else {
    result = super.getCapabilities();
  }
  
  result.setMinimumNumberInstances(0);
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 8
Source File: FilteredCollectiveClassifier.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;
  
  if (getFilter() == null)
    result = super.getCapabilities();
  else
    result = getFilter().getCapabilities();
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 9
Source File: SingleClustererEnhancer.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns default capabilities of the clusterer.
 *
 * @return		the capabilities of this clusterer
 */
public Capabilities getCapabilities() {
  Capabilities	result;
  
  if (getClusterer() == null)
    result = super.getCapabilities();
  else
    result = getClusterer().getCapabilities();
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 10
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 11
Source File: AttributeSelectedClassifier.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;
  
  if (getEvaluator() == null)
    result = super.getCapabilities();
  else
    result = getEvaluator().getCapabilities();
  
  // set dependencies
  for (Capability cap: Capability.values())
    result.enableDependency(cap);
  
  return result;
}
 
Example 12
Source File: LibSVM.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.disableAll();

   // attributes
   result.enable(Capability.NOMINAL_ATTRIBUTES);
   result.enable(Capability.NUMERIC_ATTRIBUTES);
   result.enable(Capability.DATE_ATTRIBUTES);

   // class
   result.enableDependency(Capability.UNARY_CLASS);
   result.enableDependency(Capability.NOMINAL_CLASS);
   result.enableDependency(Capability.NUMERIC_CLASS);
   result.enableDependency(Capability.DATE_CLASS);

   switch (m_SVMType) {
     case SVMTYPE_C_SVC:
     case SVMTYPE_NU_SVC:
result.enable(Capability.NOMINAL_CLASS);
break;

     case SVMTYPE_ONE_CLASS_SVM:
result.enable(Capability.UNARY_CLASS);
break;

     case SVMTYPE_EPSILON_SVR:
     case SVMTYPE_NU_SVR:
result.enable(Capability.NUMERIC_CLASS);
result.enable(Capability.DATE_CLASS);
break;

     default:
throw new IllegalArgumentException("SVMType " + m_SVMType + " is not supported!");
   }
   result.enable(Capability.MISSING_CLASS_VALUES);
   
   return result;
 }
 
Example 13
Source File: Dl4jMlpClassifier.java    From wekaDeeplearning4j 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.disableAll();

  // attributes
  if (getInstanceIterator() instanceof ImageInstanceIterator
      || getInstanceIterator() instanceof CnnTextEmbeddingInstanceIterator) {
    result.enable(Capability.STRING_ATTRIBUTES);
  } else {
    result.enable(Capability.NOMINAL_ATTRIBUTES);
    result.enable(Capability.NUMERIC_ATTRIBUTES);
    result.enable(Capability.DATE_ATTRIBUTES);
    result.enable(Capability.MISSING_VALUES);
    result.enableDependency(Capability.STRING_ATTRIBUTES); // User might
    // switch to
    // ImageDSI in GUI
  }

  // class
  result.enable(Capability.NOMINAL_CLASS);
  result.enable(Capability.NUMERIC_CLASS);
  result.enable(Capability.DATE_CLASS);
  result.enable(Capability.MISSING_CLASS_VALUES);

  return result;
}
 
Example 14
Source File: Dl4jMlpClassifier.java    From wekaDeeplearning4j 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.disableAll();

  // attributes
  if (getInstanceIterator() instanceof ImageInstanceIterator
      || getInstanceIterator() instanceof CnnTextEmbeddingInstanceIterator) {
    result.enable(Capability.STRING_ATTRIBUTES);
  } else {
    result.enable(Capability.NOMINAL_ATTRIBUTES);
    result.enable(Capability.NUMERIC_ATTRIBUTES);
    result.enable(Capability.DATE_ATTRIBUTES);
    result.enable(Capability.MISSING_VALUES);
    result.enableDependency(Capability.STRING_ATTRIBUTES); // User might
    // switch to
    // ImageDSI in GUI
  }

  // class
  result.enable(Capability.NOMINAL_CLASS);
  result.enable(Capability.NUMERIC_CLASS);
  result.enable(Capability.DATE_CLASS);
  result.enable(Capability.MISSING_CLASS_VALUES);

  return result;
}