Package weka.core

Examples of weka.core.SelectedTag


   * Get the metric type
   *
   * @return the type of metric to use for ranking rules
   */
  public SelectedTag getMetricType() {
    return new SelectedTag(m_metricType, TAGS_SELECTION);
  }
View Full Code Here


   * Get the metric type to use.
   *
   * @return the metric type to use.
   */
  public SelectedTag getMetricType() {
    return new SelectedTag(m_metric.ordinal(), AssociationRule.TAGS_SELECTION);
  }
View Full Code Here

    if (maxItemsString.length() != 0) {
      setMaxNumberOfItems(Integer.parseInt(maxItemsString));
    }
   
    if (metricTypeString.length() != 0) {
      setMetricType(new SelectedTag(Integer.parseInt(metricTypeString),
          AssociationRule.TAGS_SELECTION));
    }
   
    if (numRulesString.length() != 0) {
      setNumRulesToFind(Integer.parseInt(numRulesString));
View Full Code Here

          + "greater than one!");
      }
    }
    String negationString = Utils.getOption('G', options);
    if (negationString.length() != 0) {
      SelectedTag selected;
      int tag;
      try {
  tag = Integer.parseInt(negationString);
      } catch (Exception e) {
  throw new Exception("Invalid value for -G option: "
          + e.getMessage() + ".");
      }
      try {
  selected = new SelectedTag(tag, TAGS_NEGATION);
      } catch (Exception e) {
  throw new Exception("Value for -G option has to be "
          + "between zero and three!");
      }
      setNegation(selected);
    }
    m_classification = Utils.getFlag('S', options);
    String classIndexString = Utils.getOption('c', options);
    if (classIndexString.length() != 0) {
      try {
  m_classIndex = Integer.parseInt(classIndexString);
      } catch (Exception e) {
  throw new Exception("Invalid value for -c option: "
          + e.getMessage() + ".");
      }
    }
    m_horn = Utils.getFlag('H', options);
    if (m_horn && (m_negation != NONE)) {
      throw new Exception("Considering horn clauses doesn't make sense "
        + "if negation allowed!");
    }
   
    /* Subsumption tests options. */
    m_equivalent = !(Utils.getFlag('E', options));
    m_sameClause = !(Utils.getFlag('M', options));
    m_subsumption = !(Utils.getFlag('T', options));

    /* Missing values options. */
    String missingString = Utils.getOption('I', options);
    if (missingString.length() != 0) {
      SelectedTag selected;
      int tag;
      try {
  tag = Integer.parseInt(missingString);
      } catch (Exception e) {
  throw new Exception("Invalid value for -I option: "
          + e.getMessage() + ".");
      }
      try {
  selected = new SelectedTag(tag, TAGS_MISSING);
      } catch (Exception e) {
  throw new Exception("Value for -I option has to be "
          + "between zero and two!");
      }
      setMissingValues(selected);
    }

    /* ROC analysis. */
    m_roc = Utils.getFlag('O', options);


    /* Individual-based learning. */
    m_partsString = Utils.getOption('p', options);
    if (m_partsString.length() != 0) {
      Reader reader;
      try {
  reader = new BufferedReader(new FileReader(m_partsString));
      } catch (Exception e) {
  throw new Exception("Can't open file " + e.getMessage() + ".");
      }
      m_parts = new Instances(reader)
    }

    /* Values output. */
    String printValuesString = Utils.getOption('P', options);
    if (printValuesString.length() != 0) {
      SelectedTag selected;
      int tag;
      try {
  tag = Integer.parseInt(printValuesString);
      } catch (Exception e) {
  throw new Exception("Invalid value for -P option: "
          + e.getMessage() + ".");
      }
      try {
  selected = new SelectedTag(tag, TAGS_VALUES);
      } catch (Exception e) {
  throw new Exception("Value for -P option has to be "
          + "between zero and two!");
      }
      setValuesOutput(selected);
View Full Code Here

   *
   * @return Value of negation.
   */
  public SelectedTag getNegation() {
   
    return new SelectedTag(m_negation, TAGS_NEGATION);
  }
View Full Code Here

   *
   * @return Value of missingValues.
   */
  public SelectedTag getMissingValues() {
   
    return new SelectedTag(m_missing, TAGS_MISSING);
  }
View Full Code Here

   *
   * @return Value of valuesOutput.
   */
  public SelectedTag getValuesOutput() {
   
    return new SelectedTag(m_printValues, TAGS_VALUES);
  }
View Full Code Here

   */
  protected Filter getFilter(int algorithm, int padding) {
    Wavelet  filter;
   
    filter = new Wavelet();
    filter.setAlgorithm(new SelectedTag(algorithm, Wavelet.TAGS_ALGORITHM));
    filter.setAlgorithm(new SelectedTag(padding, Wavelet.TAGS_PADDING));
   
    return filter;
  }
View Full Code Here

  /**
   * get quality measure to be used in searching for networks.
   * @return quality measure
   */
  public SelectedTag getScoreType() {
    return new SelectedTag(m_nScoreType, TAGS_SCORE_TYPE);
  }
View Full Code Here

      setMarkovBlanketClassifier(Utils.getFlag("mbc", options));

    String sScore = Utils.getOption('S', options);

    if (sScore.compareTo("BAYES") == 0) {
      setScoreType(new SelectedTag(Scoreable.BAYES, TAGS_SCORE_TYPE));
    }
    if (sScore.compareTo("BDeu") == 0) {
      setScoreType(new SelectedTag(Scoreable.BDeu, TAGS_SCORE_TYPE));
    }
    if (sScore.compareTo("MDL") == 0) {
      setScoreType(new SelectedTag(Scoreable.MDL, TAGS_SCORE_TYPE));
    }
    if (sScore.compareTo("ENTROPY") == 0) {
      setScoreType(new SelectedTag(Scoreable.ENTROPY, TAGS_SCORE_TYPE));
    }
    if (sScore.compareTo("AIC") == 0) {
      setScoreType(new SelectedTag(Scoreable.AIC, TAGS_SCORE_TYPE));
    }
  } // setOptions
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.