Package weka.core

Examples of weka.core.SelectedTag


  public GridSearch() {
    super();
   
    // classifier
    m_Classifier = new LinearRegression();
    ((LinearRegression) m_Classifier).setAttributeSelectionMethod(new SelectedTag(LinearRegression.SELECTION_NONE, LinearRegression.TAGS_SELECTION));
    ((LinearRegression) m_Classifier).setEliminateColinearAttributes(false);
   
    // filter
    m_Filter = new PLSFilter();
    PLSFilter filter = new PLSFilter();
    filter.setPreprocessing(new SelectedTag(PLSFilter.PREPROCESSING_STANDARDIZE, PLSFilter.TAGS_PREPROCESSING));
    filter.setReplaceMissing(true);
   
    try {
      m_BestClassifier = Classifier.makeCopy(m_Classifier);
    }
View Full Code Here


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

    result = new Vector();

    desc  = "";
    for (i = 0; i < TAGS_EVALUATION.length; i++) {
      tag = new SelectedTag(TAGS_EVALUATION[i].getID(), TAGS_EVALUATION);
      desc  +=   "\t" + tag.getSelectedTag().getIDStr()
               + " = " + tag.getSelectedTag().getReadable()
               + "\n";
    }
    result.addElement(new Option(
  "\tDetermines the parameter used for evaluation:\n"
  + desc
  + "\t(default: " + new SelectedTag(EVALUATION_CC, TAGS_EVALUATION) + ")",
  "E", 1, "-E " + Tag.toOptionList(TAGS_EVALUATION)));

    result.addElement(new Option(
  "\tThe Y option to test (without leading dash).\n"
  + "\t(default: " + PREFIX_CLASSIFIER + "ridge)",
  "y-property", 1, "-y-property <option>"));

    result.addElement(new Option(
  "\tThe minimum for Y.\n"
  + "\t(default: -10)",
  "y-min", 1, "-y-min <num>"));

    result.addElement(new Option(
  "\tThe maximum for Y.\n"
  + "\t(default: +5)",
  "y-max", 1, "-y-max <num>"));

    result.addElement(new Option(
  "\tThe step size for Y.\n"
  + "\t(default: 1)",
  "y-step", 1, "-y-step <num>"));

    result.addElement(new Option(
  "\tThe base for Y.\n"
  + "\t(default: 10)",
  "y-base", 1, "-y-base <num>"));

    result.addElement(new Option(
  "\tThe expression for Y.\n"
  + "\tAvailable parameters:\n"
  + "\t\tBASE\n"
  + "\t\tFROM\n"
  + "\t\tTO\n"
  + "\t\tSTEP\n"
  + "\t\tI - the current iteration value\n"
  + "\t\t(from 'FROM' to 'TO' with stepsize 'STEP')\n"
  + "\t(default: 'pow(BASE,I)')",
  "y-expression", 1, "-y-expression <expr>"));

    result.addElement(new Option(
  "\tThe filter to use (on X axis). Full classname of filter to include, \n"
  + "\tfollowed by scheme options.\n"
  + "\t(default: weka.filters.supervised.attribute.PLSFilter)",
  "filter", 1, "-filter <filter specification>"));

    result.addElement(new Option(
  "\tThe X option to test (without leading dash).\n"
  + "\t(default: " + PREFIX_FILTER + "numComponents)",
  "x-property", 1, "-x-property <option>"));

    result.addElement(new Option(
  "\tThe minimum for X.\n"
  + "\t(default: +5)",
  "x-min", 1, "-x-min <num>"));

    result.addElement(new Option(
  "\tThe maximum for X.\n"
  + "\t(default: +20)",
  "x-max", 1, "-x-max <num>"));

    result.addElement(new Option(
  "\tThe step size for X.\n"
  + "\t(default: 1)",
  "x-step", 1, "-x-step <num>"));

    result.addElement(new Option(
  "\tThe base for X.\n"
  + "\t(default: 10)",
  "x-base", 1, "-x-base <num>"));

    result.addElement(new Option(
  "\tThe expression for the X value.\n"
  + "\tAvailable parameters:\n"
  + "\t\tBASE\n"
  + "\t\tMIN\n"
  + "\t\tMAX\n"
  + "\t\tSTEP\n"
  + "\t\tI - the current iteration value\n"
  + "\t\t(from 'FROM' to 'TO' with stepsize 'STEP')\n"
  + "\t(default: 'pow(BASE,I)')",
  "x-expression", 1, "-x-expression <expr>"));

    result.addElement(new Option(
  "\tWhether the grid can be extended.\n"
  + "\t(default: no)",
  "extend-grid", 0, "-extend-grid"));

    result.addElement(new Option(
  "\tThe maximum number of grid extensions (-1 is unlimited).\n"
  + "\t(default: 3)",
  "max-grid-extensions", 1, "-max-grid-extensions <num>"));

    result.addElement(new Option(
  "\tThe size (in percent) of the sample to search the inital grid with.\n"
  + "\t(default: 100)",
  "sample-size", 1, "-sample-size <num>"));

    result.addElement(new Option(
  "\tThe type of traversal for the grid.\n"
  + "\t(default: " + new SelectedTag(TRAVERSAL_BY_COLUMN, TAGS_TRAVERSAL) + ")",
  "traversal", 1, "-traversal " + Tag.toOptionList(TAGS_TRAVERSAL)));

    result.addElement(new Option(
  "\tThe log file to log the messages to.\n"
  + "\t(default: none)",
View Full Code Here

    while (en.hasMoreElements())
      result.addElement(en.nextElement());

    result.addElement(new Option(
  "\tThe pruning strategy.\n"
  + "\t(default: " + new SelectedTag(PRUNING_POSTPRUNING, TAGS_PRUNING) + ")",
  "P", 1, "-P " + Tag.toOptionList(TAGS_PRUNING)));

    result.addElement(new Option(
  "\tThe minimal number of instances at the terminal nodes.\n"
  + "\t(default 2)",
View Full Code Here

    String  tmpStr;
    String[]  tmpOptions;

    tmpStr = Utils.getOption('E', options);
    if (tmpStr.length() != 0)
      setEvaluation(new SelectedTag(tmpStr, TAGS_EVALUATION));
    else
      setEvaluation(new SelectedTag(EVALUATION_CC, TAGS_EVALUATION));
   
    tmpStr = Utils.getOption("y-property", options);
    if (tmpStr.length() != 0)
      setYProperty(tmpStr);
    else
      setYProperty(PREFIX_CLASSIFIER + "ridge");
   
    tmpStr = Utils.getOption("y-min", options);
    if (tmpStr.length() != 0)
      setYMin(Double.parseDouble(tmpStr));
    else
      setYMin(-10);
   
    tmpStr = Utils.getOption("y-max", options);
    if (tmpStr.length() != 0)
      setYMax(Double.parseDouble(tmpStr));
    else
      setYMax(10);
   
    tmpStr = Utils.getOption("y-step", options);
    if (tmpStr.length() != 0)
      setYStep(Double.parseDouble(tmpStr));
    else
      setYStep(1);
   
    tmpStr = Utils.getOption("y-base", options);
    if (tmpStr.length() != 0)
      setYBase(Double.parseDouble(tmpStr));
    else
      setYBase(10);
   
    tmpStr = Utils.getOption("y-expression", options);
    if (tmpStr.length() != 0)
      setYExpression(tmpStr);
    else
      setYExpression("pow(BASE,I)");
   
    tmpStr     = Utils.getOption("filter", options);
    tmpOptions = Utils.splitOptions(tmpStr);
    if (tmpOptions.length != 0) {
      tmpStr        = tmpOptions[0];
      tmpOptions[0] = "";
      setFilter((Filter) Utils.forName(Filter.class, tmpStr, tmpOptions));
    }
   
    tmpStr = Utils.getOption("x-property", options);
    if (tmpStr.length() != 0)
      setXProperty(tmpStr);
    else
      setXProperty(PREFIX_FILTER + "filters[0].kernel.gamma");
   
    tmpStr = Utils.getOption("x-min", options);
    if (tmpStr.length() != 0)
      setXMin(Double.parseDouble(tmpStr));
    else
      setXMin(-10);
   
    tmpStr = Utils.getOption("x-max", options);
    if (tmpStr.length() != 0)
      setXMax(Double.parseDouble(tmpStr));
    else
      setXMax(10);
   
    tmpStr = Utils.getOption("x-step", options);
    if (tmpStr.length() != 0)
      setXStep(Double.parseDouble(tmpStr));
    else
      setXStep(1);
   
    tmpStr = Utils.getOption("x-base", options);
    if (tmpStr.length() != 0)
      setXBase(Double.parseDouble(tmpStr));
    else
      setXBase(10);
   
    tmpStr = Utils.getOption("x-expression", options);
    if (tmpStr.length() != 0)
      setXExpression(tmpStr);
    else
      setXExpression("pow(BASE,I)");
   
    setGridIsExtendable(Utils.getFlag("extend-grid", options));
    if (getGridIsExtendable()) {
      tmpStr = Utils.getOption("max-grid-extensions", options);
      if (tmpStr.length() != 0)
        setMaxGridExtensions(Integer.parseInt(tmpStr));
      else
        setMaxGridExtensions(3);
    }
   
    tmpStr = Utils.getOption("sample-size", options);
    if (tmpStr.length() != 0)
      setSampleSizePercent(Double.parseDouble(tmpStr));
    else
      setSampleSizePercent(100);
   
    tmpStr = Utils.getOption("traversal", options);
    if (tmpStr.length() != 0)
      setTraversal(new SelectedTag(tmpStr, TAGS_TRAVERSAL));
    else
      setTraversal(new SelectedTag(TRAVERSAL_BY_ROW, TAGS_TRAVERSAL));
   
    tmpStr = Utils.getOption("log-file", options);
    if (tmpStr.length() != 0)
      setLogFile(new File(tmpStr));
    else
View Full Code Here

    else
      setSizePer(1);

    tmpStr = Utils.getOption('P', options);
    if (tmpStr.length() != 0)
      setPruningStrategy(new SelectedTag(tmpStr, TAGS_PRUNING));
    else
      setPruningStrategy(new SelectedTag(PRUNING_POSTPRUNING, TAGS_PRUNING));

    setHeuristic(!Utils.getFlag('H',options));

    setUseGini(!Utils.getFlag('G',options));
   
View Full Code Here

   * Gets the pruning strategy.
   *
   * @return     the current strategy.
   */
  public SelectedTag getPruningStrategy() {
    return new SelectedTag(m_PruningStrategy, TAGS_PRUNING);
  }
View Full Code Here

   * Gets the criterion used for evaluating the classifier performance.
   *
   * @return     the current evaluation criterion.
   */
  public SelectedTag getEvaluation() {
    return new SelectedTag(m_Evaluation, TAGS_EVALUATION);
  }
View Full Code Here

   * Gets the type of traversal for the grid.
   *
   * @return     the current traversal type.
   */
  public SelectedTag getTraversal() {
    return new SelectedTag(m_Traversal, TAGS_TRAVERSAL);
  }
View Full Code Here

  public void setOptions(String[] options) throws Exception {
    setDebug(Utils.getFlag('D', options));

    String nString = Utils.getOption('N', options);
    if (nString.length() != 0) {
      setFilterType(new SelectedTag(Integer.parseInt(nString), TAGS_FILTER));
    } else {
      setFilterType(new SelectedTag(FILTER_NORMALIZE, TAGS_FILTER));
    }
  }
View Full Code Here

   *
   * @return the filtering mode
   */
  public SelectedTag getFilterType() {

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