Package weka.core

Examples of weka.core.SelectedTag


   *
   * @return a value of type 'String'
   */
  public String getAsText() {

    SelectedTag s = (SelectedTag)getValue();
    return s.getSelectedTag().getReadable();
  }
View Full Code Here


   * @exception java.lang.IllegalArgumentException if an error occurs
   */
  public void setAsText(String text)
    {

    SelectedTag s = (SelectedTag)getValue();
    Tag [] tags = s.getTags();
    try {
      for (int i = 0; i < tags.length; i++) {
  if (text.equals(tags[i].getReadable())) {
    setValue(new SelectedTag(tags[i].getID(), tags));
    return;
  }
      }
    } catch (Exception ex) {
      throw new java.lang.IllegalArgumentException(text);
View Full Code Here

   *
   * @return an array of string tags.
   */
  public String[] getTags() {

    SelectedTag s = (SelectedTag)getValue();
    Tag [] tags = s.getTags();
    String [] result = new String [tags.length];
    for (int i = 0; i < tags.length; i++) {
      result[i] = tags[i].getReadable();
    }
    return result;
View Full Code Here

  new Tag(2, Messages.getInstance().getString("SelectedTagEditor_Main_Tags_Text_Second")),
  new Tag(3, Messages.getInstance().getString("SelectedTagEditor_Main_Tags_Text_Third")),
  new Tag(4, Messages.getInstance().getString("SelectedTagEditor_Main_Tags_Text_Fourth")),
  new Tag(5, Messages.getInstance().getString("SelectedTagEditor_Main_Tags_Text_Fifth")),
      };
      SelectedTag initial = new SelectedTag(1, tags);
      SelectedTagEditor ce = new SelectedTagEditor();
      ce.setValue(initial);
      PropertyValueSelector ps = new PropertyValueSelector(ce);
      JFrame f = new JFrame();
      f.addWindowListener(new WindowAdapter() {
View Full Code Here

   *
   * @return the tree searching mode
   */
  public SelectedTag getSearchPath() {

    return new SelectedTag(m_searchPath, TAGS_SEARCHPATH);
  }
View Full Code Here

    String eString = Utils.getOption('E', options);
    if (eString.length() != 0) {
      int value = Integer.parseInt(eString);
      if (value >= 0) {
  setSearchPath(new SelectedTag(SEARCHPATH_RANDOM, TAGS_SEARCHPATH));
  setRandomSeed(value);
      } else setSearchPath(new SelectedTag(value + 3, TAGS_SEARCHPATH));
    }

    setSaveInstanceData(Utils.getFlag('D', options));

    Utils.checkForRemainingOptions(options);
View Full Code Here

      setValidationChunkSize(1000);
    }

    String pruneType = Utils.getOption('P', options);
    if (pruneType.length() != 0) {
      setPruningType(new SelectedTag(Integer.parseInt(pruneType), TAGS_PRUNETYPE));
    } else {
      setPruningType(new SelectedTag(PRUNETYPE_LOGLIKELIHOOD, TAGS_PRUNETYPE));
    }

    setUseResampling(Utils.getFlag('Q', options));

    super.setOptions(options);
View Full Code Here

   *
   * @return the type
   */
  public SelectedTag getPruningType() {

    return new SelectedTag(m_PruningType, TAGS_PRUNETYPE);
  }
View Full Code Here

      } catch (Exception ex) {
  // now flag as possible old format cost matrix. Delay cost matrix
  // loading until buildClassifer is called
  setCostMatrix(null);
      }
      setCostMatrixSource(new SelectedTag(MATRIX_SUPPLIED,
                                          TAGS_MATRIX_SOURCE));
      m_CostFile = costFile;
    } else {
      setCostMatrixSource(new SelectedTag(MATRIX_ON_DEMAND,
                                          TAGS_MATRIX_SOURCE));
    }
   
    String demandDir = Utils.getOption('N', options);
    if (demandDir.length() != 0) {
      setOnDemandDirectory(new File(demandDir));
    }

    String cost_matrix = Utils.getOption("cost-matrix", options);
    if (cost_matrix.length() != 0) {
      StringWriter writer = new StringWriter();
      CostMatrix.parseMatlab(cost_matrix).write(writer);
      setCostMatrix(new CostMatrix(new StringReader(writer.toString())));
      setCostMatrixSource(new SelectedTag(MATRIX_SUPPLIED,
                                          TAGS_MATRIX_SOURCE));
    }

    String seed = Utils.getOption('S', options);
    if (seed.length() != 0) {
View Full Code Here

   *
   * @return the cost matrix source.
   */
  public SelectedTag getCostMatrixSource() {

    return new SelectedTag(m_MatrixSource, TAGS_MATRIX_SOURCE);
  }
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.