Package weka.core

Examples of weka.core.SelectedTag


  /** Creates a specialized RemoveType */
  public Filter getFilter(int attType) {
   
    RemoveType af = new RemoveType();
    try {
      af.setAttributeType(new SelectedTag(attType,
                                          RemoveType.TAGS_ATTRIBUTETYPE));
    } catch (Exception ex) {
      ex.printStackTrace();
      fail("Couldn't set up filter with attribute type: " + attType);
    }
View Full Code Here


    }

    mString = Utils.getOption('D', options);
    if(mString.length()!=0) {
  if(mString.equalsIgnoreCase("sparse1"))
     setDistribution( new SelectedTag(SPARSE1, TAGS_DSTRS_TYPE) );
  else if(mString.equalsIgnoreCase("sparse2"))
     setDistribution( new SelectedTag(SPARSE2, TAGS_DSTRS_TYPE) );
  else if(mString.equalsIgnoreCase("gaussian"))
     setDistribution( new SelectedTag(GAUSSIAN, TAGS_DSTRS_TYPE) );    
    }

    if(Utils.getFlag('M', options))
  setReplaceMissingValues(true);
    else
View Full Code Here

    }
   
    options[current++] = "-R";
    options[current++] = "" + getRandomSeed();
   
    SelectedTag t = getDistribution();
    options[current++] = "-D";
    options[current++] = ""+t.getSelectedTag().getReadable();


    while (current < options.length) {
      options[current++] = "";
    }
View Full Code Here

   * random matrix
   *
   * @return the current distribution
   */
  public SelectedTag getDistribution() {
      return new SelectedTag(m_distribution, TAGS_DSTRS_TYPE);
  }
View Full Code Here

  public Classifier getClassifier() {
    GridSearch    result;
   
    result = new GridSearch();
   
    result.setEvaluation(new SelectedTag(GridSearch.EVALUATION_ACC, GridSearch.TAGS_EVALUATION));
   
    // classifier
    result.setClassifier(new weka.classifiers.trees.J48());
    result.setYProperty("classifier.confidenceFactor");
    result.setYMin(0.2);
View Full Code Here

   */
  public Enumeration listOptions() {
    Vector    result;
    Enumeration    enm;
    String    param;
    SelectedTag    tag;
    int      i;

    result = new Vector();

    enm = super.listOptions();
    while (enm.hasMoreElements())
      result.addElement(enm.nextElement());

    param = "";
    for (i = 0; i < TAGS_ALGORITHM.length; i++) {
      if (i > 0)
  param += "|";
      tag = new SelectedTag(TAGS_ALGORITHM[i].getID(), TAGS_ALGORITHM);
      param += tag.getSelectedTag().getReadable();
    }
    result.addElement(new Option(
  "\tThe algorithm to use.\n"
  + "\t(default: HAAR)",
  "A", 1, "-A <" + param + ">"));

    param = "";
    for (i = 0; i < TAGS_PADDING.length; i++) {
      if (i > 0)
  param += "|";
      tag = new SelectedTag(TAGS_PADDING[i].getID(), TAGS_PADDING);
      param += tag.getSelectedTag().getReadable();
    }
    result.addElement(new Option(
  "\tThe padding to use.\n"
  + "\t(default: ZERO)",
  "P", 1, "-P <" + param + ">"));
View Full Code Here

    super.setOptions(options);

    tmpStr = Utils.getOption("A", options);
    if (tmpStr.length() != 0)
      setAlgorithm(new SelectedTag(tmpStr, TAGS_ALGORITHM));
    else
      setAlgorithm(new SelectedTag(ALGORITHM_HAAR, TAGS_ALGORITHM));

    tmpStr = Utils.getOption("P", options);
    if (tmpStr.length() != 0)
      setPadding(new SelectedTag(tmpStr, TAGS_PADDING));
    else
      setPadding(new SelectedTag(PADDING_ZERO, TAGS_PADDING));

    tmpStr     = Utils.getOption("F", options);
    tmpOptions = Utils.splitOptions(tmpStr);
    if (tmpOptions.length != 0) {
      tmpStr        = tmpOptions[0];
View Full Code Here

   * Gets the type of algorithm to use
   *
   * @return     the current algorithm type.
   */
  public SelectedTag getAlgorithm() {
    return new SelectedTag(m_Algorithm, TAGS_ALGORITHM);
  }
View Full Code Here

   * Gets the type of Padding to use
   *
   * @return     the current Padding type.
   */
  public SelectedTag getPadding() {
    return new SelectedTag(m_Padding, TAGS_PADDING);
  }
View Full Code Here

    numAtts = nextPowerOf2(data.numAttributes()) - data.numAttributes();
  break;
 
      default:
  throw new IllegalStateException(
      "Padding " + new SelectedTag(m_Algorithm, TAGS_PADDING)
      + " not implemented!");
    }

    result = new Instances(data);
    prefix = getAlgorithm().getSelectedTag().getReadable();
View Full Code Here

TOP

Related Classes of weka.core.SelectedTag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.