public static void main(String args[]) { ProblemTransformationMethod.evaluation(new LC(), args); }
/** * 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; }
@Override public void buildClassifier(Instances D) throws Exception { testCapabilities(D); int L = D.classIndex(); // Transform Instances if(getDebug()) System.out.print("Transforming Instances ..."); Instances D_ = PSUtils.LCTransformation(D,L); m_InstancesTemplate = new Instances(D_,0); // Set Info ; Build Classifier info = "K = "+m_InstancesTemplate.attribute(0).numValues() + ", N = "+D_.numInstances(); if(getDebug()) System.out.print("Building Classifier ("+info+"), ..."); m_Classifier.buildClassifier(D_); if(getDebug()) System.out.println("Done"); }
@Override public Enumeration listOptions() { Vector result = new Vector(); result.addElement(new Option("\tSets the pruning value, defining an infrequent labelset as one which occurs <= P times in the data (P = 0 defaults to LC).\n\tdefault: "+m_P+"\t(LC)", "P", 1, "-P <value>")); result.addElement(new Option("\tSets the (maximum) number of frequent labelsets to subsample from the infrequent labelsets.\n\tdefault: "+m_N+"\t(none)\n\tn\tN = n\n\t-n\tN = n, or 0 if LCard(D) >= 2\n\tn-m\tN = random(n,m)", "N", 1, "-N <value>")); result.addElement(new Option("\tThe seed value for randomization\n\tdefault: 0", "S", 1, "-S <value>")); OptionUtils.add(result, super.listOptions()); return OptionUtils.toEnumeration(result); }
@Override public String [] getOptions() { List<String> result = new ArrayList<>(); OptionUtils.add(result, 'P', getP()); OptionUtils.add(result, 'N', getN()); OptionUtils.add(result, 'S', getSeed()); OptionUtils.add(result, super.getOptions()); return OptionUtils.toArray(result); }
@Override public void setOptions(String[] options) throws Exception { String tmpStr; tmpStr = Utils.getOption('P', options); if (tmpStr.length() != 0) setP(parseValue(tmpStr)); else setP(parseValue("0")); tmpStr = Utils.getOption('N', options); if (tmpStr.length() != 0) setN(parseValue(tmpStr)); else setN(parseValue("0")); setSeed(OptionUtils.parse(options, 'S', 0)); super.setOptions(options); }
@Override public Enumeration listOptions() { Vector result = new Vector(); result.addElement(new Option("\tSets the pruning value, defining an infrequent labelset as one which occurs <= P times in the data (P = 0 defaults to LC).\n\tdefault: "+m_P+"\t(LC)", "P", 1, "-P <value>")); result.addElement(new Option("\tSets the (maximum) number of frequent labelsets to subsample from the infrequent labelsets.\n\tdefault: "+m_N+"\t(none)\n\tn\tN = n\n\t-n\tN = n, or 0 if LCard(D) >= 2\n\tn-m\tN = random(n,m)", "N", 1, "-N <value>")); result.addElement(new Option("\tThe seed value for randomization\n\tdefault: 0", "S", 1, "-S <value>")); OptionUtils.add(result, super.listOptions()); return OptionUtils.toEnumeration(result); }
@Override public String [] getOptions() { List<String> result = new ArrayList<>(); OptionUtils.add(result, 'P', getP()); OptionUtils.add(result, 'N', getN()); OptionUtils.add(result, 'S', getSeed()); OptionUtils.add(result, super.getOptions()); return OptionUtils.toArray(result); }
@Override public void setOptions(String[] options) throws Exception { String tmpStr; tmpStr = Utils.getOption('P', options); if (tmpStr.length() != 0) setP(parseValue(tmpStr)); else setP(parseValue("0")); tmpStr = Utils.getOption('N', options); if (tmpStr.length() != 0) setN(parseValue(tmpStr)); else setN(parseValue("0")); setSeed(OptionUtils.parse(options, 'S', 0)); super.setOptions(options); }
@Override public void buildClassifier(Instances D) throws Exception { testCapabilities(D); int L = D.classIndex(); // Transform Instances if(getDebug()) System.out.print("Transforming Instances ..."); Instances D_ = PSUtils.LCTransformation(D,L); m_InstancesTemplate = new Instances(D_,0); // Set Info ; Build Classifier info = "K = "+m_InstancesTemplate.attribute(0).numValues() + ", N = "+D_.numInstances(); if(getDebug()) System.out.print("Building Classifier ("+info+"), ..."); m_Classifier.buildClassifier(D_); if(getDebug()) System.out.println("Done"); }
/** * 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; }
public static void main(String args[]) { ProblemTransformationMethod.evaluation(new LC(), args); }
/** * 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; }
/** * 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; }