weka.core.Drawable Java Examples

The following examples show how to use weka.core.Drawable. 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: BR.java    From meka with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a string that describes a graph representing
 * the object. The string should be in XMLBIF ver.
 * 0.3 format if the graph is a BayesNet, otherwise
 * it should be in dotty format.
 *
 * @return the graph described by a string (label index as key)
 * @throws Exception if the graph can't be computed
 */
public Map<Integer,String> graph() throws Exception {
	Map<Integer,String>		result;
	int						i;

	result = new HashMap<Integer,String>();

	if (m_MultiClassifiers != null) {
		for (i = 0; i < m_MultiClassifiers.length; i++) {
			if (m_MultiClassifiers[i] instanceof Drawable) {
				result.put(i, ((Drawable) m_MultiClassifiers[i]).graph());
			}
		}
	}

	return result;
}
 
Example #2
Source File: RAkELd.java    From meka with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns a string that describes a graph representing
 * the object. The string should be in XMLBIF ver.
 * 0.3 format if the graph is a BayesNet, otherwise
 * it should be in dotty format.
 *
 * @return the graph described by a string (label index as key)
 * @throws Exception if the graph can't be computed
 */
@Override
public Map<Integer,String> graph() throws Exception {
	Map<Integer,String>		result;

	result = new HashMap<Integer,String>();

	for (int i = 0; i < m_Classifiers.length; i++) {
		if (m_Classifiers[i] != null) {
			if (m_Classifiers[i] instanceof Drawable) {
				result.put(i, ((Drawable) m_Classifiers[i]).graph());
			}
		}
	}

	return result;
}
 
Example #3
Source File: BR.java    From meka with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns the type of graph representing
 * the object.
 *
 * @return the type of graph representing the object (label index as key)
 */
public Map<Integer,Integer> graphType() {
	Map<Integer,Integer>	result;
	int						i;

	result = new HashMap<Integer,Integer>();

	if (m_MultiClassifiers != null) {
		for (i = 0; i < m_MultiClassifiers.length; i++) {
			if (m_MultiClassifiers[i] instanceof Drawable) {
				result.put(i, ((Drawable) m_MultiClassifiers[i]).graphType());
			}
		}
	}

	return result;
}
 
Example #4
Source File: LC.java    From meka with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns a string that describes a graph representing
 * the object. The string should be in XMLBIF ver.
 * 0.3 format if the graph is a BayesNet, otherwise
 * it should be in dotty format.
 *
 * @return the graph described by a string (label index as key)
 * @throws Exception if the graph can't be computed
 */
public Map<Integer,String> graph() throws Exception {
	Map<Integer,String>		result;

	result = new HashMap<Integer,String>();

	if (getClassifier() != null) {
		if (getClassifier() instanceof Drawable) {
			result.put(0, ((Drawable) getClassifier()).graph());
		}
	}

	return result;
}
 
Example #5
Source File: InputMappedClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  
 *  @return the type of graph
 */   
public int graphType() {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graphType();
  else 
    return Drawable.NOT_DRAWABLE;
}
 
Example #6
Source File: InputMappedClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns graph describing the classifier (if possible).
 *
 * @return the graph of the classifier in dotty format
 * @throws Exception if the classifier cannot be graphed
 */
public String graph() throws Exception {
  
  if (m_Classifier != null && 
      m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graph();
  else throw new Exception("Classifier: " + getClassifierSpec()
                           + " cannot be graphed");
}
 
Example #7
Source File: AttributeSelectedClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns graph describing the classifier (if possible).
 *
 * @return the graph of the classifier in dotty format
 * @throws Exception if the classifier cannot be graphed
 */
public String graph() throws Exception {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graph();
  else throw new Exception("Classifier: " + getClassifierSpec()
	     + " cannot be graphed");
}
 
Example #8
Source File: AttributeSelectedClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  
 *  @return the type of graph
 */   
public int graphType() {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graphType();
  else 
    return Drawable.NOT_DRAWABLE;
}
 
Example #9
Source File: CVParameterSelection.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns graph describing the classifier (if possible).
 *
 * @return the graph of the classifier in dotty format
 * @throws Exception if the classifier cannot be graphed
 */
public String graph() throws Exception {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graph();
  else throw new Exception("Classifier: " + 
	     m_Classifier.getClass().getName() + " " +
	     Utils.joinOptions(m_BestClassifierOptions)
	     + " cannot be graphed");
}
 
Example #10
Source File: CVParameterSelection.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  
 *  @return the type of graph this classifier represents
 */   
public int graphType() {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graphType();
  else 
    return Drawable.NOT_DRAWABLE;
}
 
Example #11
Source File: CostSensitiveClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns graph describing the classifier (if possible).
 *
 * @return the graph of the classifier in dotty format
 * @throws Exception if the classifier cannot be graphed
 */
public String graph() throws Exception {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graph();
  else throw new Exception("Classifier: " + getClassifierSpec()
	     + " cannot be graphed");
}
 
Example #12
Source File: CostSensitiveClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  
 *  @return the type of graph this classifier represents
 */   
public int graphType() {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graphType();
  else 
    return Drawable.NOT_DRAWABLE;
}
 
Example #13
Source File: FilteredClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns graph describing the classifier (if possible).
 *
 * @return the graph of the classifier in dotty format
 * @throws Exception if the classifier cannot be graphed
 */
public String graph() throws Exception {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graph();
  else throw new Exception("Classifier: " + getClassifierSpec()
	     + " cannot be graphed");
}
 
Example #14
Source File: FilteredClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the type of graph this classifier
 * represents.
 *  
 * @return the graph type of this classifier
 */   
public int graphType() {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graphType();
  else 
    return Drawable.NOT_DRAWABLE;
}
 
Example #15
Source File: ThresholdSelector.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns graph describing the classifier (if possible).
 *
 * @return the graph of the classifier in dotty format
 * @throws Exception if the classifier cannot be graphed
 */
public String graph() throws Exception {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graph();
  else throw new Exception("Classifier: " + getClassifierSpec()
	     + " cannot be graphed");
}
 
Example #16
Source File: ThresholdSelector.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the type of graph this classifier
 * represents.
 *  
 * @return the type of graph this classifier represents
 */   
public int graphType() {
  
  if (m_Classifier instanceof Drawable)
    return ((Drawable)m_Classifier).graphType();
  else 
    return Drawable.NOT_DRAWABLE;
}
 
Example #17
Source File: LC.java    From meka with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the type of graph representing
 * the object.
 *
 * @return the type of graph representing the object (label index as key)
 */
public Map<Integer,Integer> graphType() {
	Map<Integer,Integer>	result;

	result = new HashMap<Integer,Integer>();

	if (getClassifier() != null) {
		if (getClassifier() instanceof Drawable) {
			result.put(0, ((Drawable) getClassifier()).graphType());
		}
	}

	return result;
}
 
Example #18
Source File: ClusterEvaluation.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
  * Make up the help string giving all the command line options
  *
  * @param clusterer the clusterer to include options for
  * @return a string detailing the valid command line options
  */
 private static String makeOptionString (Clusterer clusterer,
                                         boolean globalInfo) {
   StringBuffer optionsText = new StringBuffer("");
   // General options
   optionsText.append("\n\nGeneral options:\n\n");
   optionsText.append("-h or -help\n");
   optionsText.append("\tOutput help information.\n");
   optionsText.append("-synopsis or -info\n");
   optionsText.append("\tOutput synopsis for clusterer (use in conjunction "
       + " with -h)\n");
   optionsText.append("-t <name of training file>\n");
   optionsText.append("\tSets training file.\n");
   optionsText.append("-T <name of test file>\n");
   optionsText.append("\tSets test file.\n");
   optionsText.append("-l <name of input file>\n");
   optionsText.append("\tSets model input file.\n");
   optionsText.append("-d <name of output file>\n");
   optionsText.append("\tSets model output file.\n");
   optionsText.append("-p <attribute range>\n");
   optionsText.append("\tOutput predictions. Predictions are for " 
	       + "training file" 
	       + "\n\tif only training file is specified," 
	       + "\n\totherwise predictions are for the test file."
	       + "\n\tThe range specifies attribute values to be output"
	       + "\n\twith the predictions. Use '-p 0' for none.\n");
   optionsText.append("-x <number of folds>\n");
   optionsText.append("\tOnly Distribution Clusterers can be cross validated.\n");
   optionsText.append("-s <random number seed>\n");
   optionsText.append("\tSets the seed for randomizing the data in cross-validation\n");
   optionsText.append("-c <class index>\n");
   optionsText.append("\tSet class attribute. If supplied, class is ignored");
   optionsText.append("\n\tduring clustering but is used in a classes to");
   optionsText.append("\n\tclusters evaluation.\n");
   if (clusterer instanceof Drawable) {
     optionsText.append("-g <name of graph file>\n");
     optionsText.append("\tOutputs the graph representation of the clusterer to the file.\n");
   }

   // Get scheme-specific options
   if (clusterer instanceof OptionHandler) {
     optionsText.append("\nOptions specific to " 
		 + clusterer.getClass().getName() + ":\n\n");
     Enumeration enu = ((OptionHandler)clusterer).listOptions();

     while (enu.hasMoreElements()) {
Option option = (Option)enu.nextElement();
optionsText.append(option.synopsis() + '\n');
optionsText.append(option.description() + "\n");
     }
   }
   
   // Get global information (if available)
   if (globalInfo) {
     try {
       String gi = getGlobalInfo(clusterer);
       optionsText.append(gi);
     } catch (Exception ex) {
       // quietly ignore
     }
   }

   return  optionsText.toString();
 }
 
Example #19
Source File: HoeffdingTree.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int graphType() {
  return Drawable.TREE;
}
 
Example #20
Source File: HierarchicalClusterer.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int graphType() {
  return Drawable.Newick;
}
 
Example #21
Source File: NBTree.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
    return Drawable.TREE;
}
 
Example #22
Source File: FT.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
  return Drawable.TREE;
}
 
Example #23
Source File: M5P.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
    return Drawable.TREE;
}
 
Example #24
Source File: LMT.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
  return Drawable.TREE;
}
 
Example #25
Source File: J48.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
    return Drawable.TREE;
}
 
Example #26
Source File: J48graft.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
    return Drawable.TREE;
}
 
Example #27
Source File: BayesNet.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
  return Drawable.BayesNet;
}
 
Example #28
Source File: REPTree.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
    return Drawable.TREE;
}
 
Example #29
Source File: ADTree.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
    return Drawable.TREE;
}
 
Example #30
Source File: ClassifierTree.java    From tsml with GNU General Public License v3.0 2 votes vote down vote up
/**
 *  Returns the type of graph this classifier
 *  represents.
 *  @return Drawable.TREE
 */   
public int graphType() {
    return Drawable.TREE;
}