类weka.core.SelectedTag源码实例Demo

下面列出了怎么用weka.core.SelectedTag的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: tsml   文件: Apriori.java
/**
 * Set the metric type for ranking rules
 * 
 * @param d the type of metric
 */
public void setMetricType(SelectedTag d) {

  if (d.getTags() == TAGS_SELECTION) {
    m_metricType = d.getSelectedTag().getID();
  }

  if (m_metricType == CONFIDENCE) {
    setMinMetric(0.9);
  }

  if (m_metricType == LIFT || m_metricType == CONVICTION) {
    setMinMetric(1.1);
  }

  if (m_metricType == LEVERAGE) {
    setMinMetric(0.1);
  }
}
 
源代码2 项目: tsml   文件: ADTree.java
/**
  * Parses a given list of options. Valid options are:<p>
  *
  * -B num <br>
  * Set the number of boosting iterations
  * (default 10) <p>
  *
  * -E num <br>
  * Set the nodes to expand: -3(all), -2(weight), -1(z_pure), >=0 seed for random walk
  * (default -3) <p>
  *
  * -D <br>
  * Save the instance data with the model <p>
  *
  * @param options the list of options as an array of strings
  * @exception Exception if an option is not supported
  */
 public void setOptions(String[] options) throws Exception {
   
   String bString = Utils.getOption('B', options);
   if (bString.length() != 0) setNumOfBoostingIterations(Integer.parseInt(bString));

   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);
 }
 
源代码3 项目: tsml   文件: FPGrowth.java
/**
 * Set the metric type to use.
 * 
 * @param d the metric type
 */
public void setMetricType(SelectedTag d) {
  int ordinal =  d.getSelectedTag().getID();
  for (DefaultAssociationRule.METRIC_TYPE m : DefaultAssociationRule.METRIC_TYPE.values()) {
    if (m.ordinal() == ordinal) {
      m_metric = m;
      break;
    }
  }
}
 
源代码4 项目: tsml   文件: BestFirst.java
/**
 * Parses a given list of options. <p/>
 *
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -P &lt;start set&gt;
 *  Specify a starting set of attributes.
 *  Eg. 1,3,5-7.</pre>
 * 
 * <pre> -D &lt;0 = backward | 1 = forward | 2 = bi-directional&gt;
 *  Direction of search. (default = 1).</pre>
 * 
 * <pre> -N &lt;num&gt;
 *  Number of non-improving nodes to
 *  consider before terminating search.</pre>
 * 
 * <pre> -S &lt;num&gt;
 *  Size of lookup cache for evaluated subsets.
 *  Expressed as a multiple of the number of
 *  attributes in the data set. (default = 1)</pre>
 * 
 <!-- options-end -->
 *
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 *
 **/
public void setOptions (String[] options)
  throws Exception {
  String optionString;
  resetOptions();

  optionString = Utils.getOption('P', options);
  if (optionString.length() != 0) {
    setStartSet(optionString);
  }

  optionString = Utils.getOption('D', options);

  if (optionString.length() != 0) {
    setDirection(new SelectedTag(Integer.parseInt(optionString),
		   TAGS_SELECTION));
  } else {
    setDirection(new SelectedTag(SELECTION_FORWARD, TAGS_SELECTION));
  }

  optionString = Utils.getOption('N', options);

  if (optionString.length() != 0) {
    setSearchTermination(Integer.parseInt(optionString));
  }

  optionString = Utils.getOption('S', options);
  if (optionString.length() != 0) {
    setLookupCacheSize(Integer.parseInt(optionString));
  }

  m_debug = Utils.getFlag('Z', options);
}
 
源代码5 项目: tsml   文件: RandomProjection.java
/**
 * Gets the current settings of the filter.
 *
 * @return an array of strings suitable for passing to setOptions
 */
public String [] getOptions() {

  String [] options = new String [10];
  int current = 0;

  //if (getUseGaussian()) {
  //  options[current++] = "-G";
  //}

  if (getReplaceMissingValues()) {
    options[current++] = "-M";
  }

  if (getPercent() == 0) {
    options[current++] = "-N";
    options[current++] = "" + getNumberOfAttributes();
  }
  else {
    options[current++] = "-P";
    options[current++] = "" + getPercent();
  }
  
  options[current++] = "-R";
  options[current++] = "" + getRandomSeed();
  
  SelectedTag t = getDistribution();
  options[current++] = "-D";
  options[current++] = ""+t.getSelectedTag().getReadable();


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

  return options;
}
 
源代码6 项目: tsml   文件: ScatterSearchV1.java
/**
 * Parses a given list of options.
 *
 <!-- options-start -->
 * Valid options are: <p>
 *
 * -Z <br>
 * Specify the number of subsets to generate in the initial population.<p>
 *
 * -T <start set> <br>
 * Specify the treshold used for considering when a subset is significant. <p>
 *
 * -R <br>
 * Specify the kind of combiantion. <p>
 *
 * -S <br>
 *  Set the random number seed.
 *  (default = 1)
 *
 * -D <br>
 *  Verbose output for monitoring the search
 *  (default = false)
 *  
 <!-- options-end -->
 *
 * @param options the list of options as an array of strings
 * @exception Exception if an option is not supported
 *
 **/
public void setOptions (String[] options)
  throws Exception {
  String optionString;
  resetOptions();

  optionString = Utils.getOption('Z', options);
  if (optionString.length() != 0) {
    setPopulationSize(Integer.parseInt(optionString));
  }

  optionString = Utils.getOption('T', options);
  if (optionString.length() != 0) {
    setThreshold(Double.parseDouble(optionString));
  }

  optionString = Utils.getOption('R', options);
  if (optionString.length() != 0) {
    setCombination(new SelectedTag(Integer.parseInt(optionString),
		   TAGS_SELECTION));
  } else {
    setCombination(new SelectedTag(COMBINATION_NOT_REDUCED, TAGS_SELECTION));
  }

  optionString = Utils.getOption('S', options);
  if (optionString.length() != 0) {
    setSeed(Integer.parseInt(optionString));
  }

  setDebug(Utils.getFlag('D', options));
}
 
源代码7 项目: tsml   文件: LinearRegression.java
/**
 * Sets the method used to select attributes for use in the
 * linear regression. 
 *
 * @param method the attribute selection method to use.
 */
public void setAttributeSelectionMethod(SelectedTag method) {
  
  if (method.getTags() == TAGS_SELECTION) {
    m_AttributeSelection = method.getSelectedTag().getID();
  }
}
 
源代码8 项目: tsml   文件: SMO.java
/**
 * Sets how the training data will be transformed. Should be one of
 * FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.
 *
 * @param newType the new filtering mode
 */
public void setFilterType(SelectedTag newType) {
  
  if (newType.getTags() == TAGS_FILTER) {
    m_filterType = newType.getSelectedTag().getID();
  }
}
 
源代码9 项目: tsml   文件: MIDD.java
/**
 * Sets how the training data will be transformed. Should be one of
 * FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.
 *
 * @param newType the new filtering mode
 */
public void setFilterType(SelectedTag newType) {

  if (newType.getTags() == TAGS_FILTER) {
    m_filterType = newType.getSelectedTag().getID();
  }
}
 
源代码10 项目: tsml   文件: PaceRegression.java
/**
 * Sets the estimator.
 *
 * @param estimator the new estimator
 */
public void setEstimator(SelectedTag estimator) {
  
  if (estimator.getTags() == TAGS_ESTIMATOR) {
    paceEstimator = estimator.getSelectedTag().getID();
  }
}
 
源代码11 项目: tsml   文件: CostSensitiveClassifier.java
/**
 * Sets the source location of the cost matrix. Values other than
 * MATRIX_ON_DEMAND or MATRIX_SUPPLIED will be ignored.
 *
 * @param newMethod the cost matrix location method.
 */
public void setCostMatrixSource(SelectedTag newMethod) {
  
  if (newMethod.getTags() == TAGS_MATRIX_SOURCE) {
    m_MatrixSource = newMethod.getSelectedTag().getID();
  }
}
 
源代码12 项目: tsml   文件: KStar.java
/**
 * Sets the method to use for handling missing values. Values other than
 * M_NORMAL, M_AVERAGE, M_MAXDIFF and M_DELETE will be ignored.
 *
 * @param newMode the method to use for handling missing values.
 */
public void setMissingMode(SelectedTag newMode) {
  
  if (newMode.getTags() == TAGS_MISSING) {
    m_MissingMode = newMode.getSelectedTag().getID();
  }
}
 
源代码13 项目: tsml   文件: KStar.java
/**
  * Parses a given list of options. <p/>
  *
  <!-- options-start -->
  * Valid options are: <p/>
  * 
  * <pre> -B &lt;num&gt;
  *  Manual blend setting (default 20%)
  * </pre>
  * 
  * <pre> -E
  *  Enable entropic auto-blend setting (symbolic class only)
  * </pre>
  * 
  * <pre> -M &lt;char&gt;
  *  Specify the missing value treatment mode (default a)
  *  Valid options are: a(verage), d(elete), m(axdiff), n(ormal)
  * </pre>
  * 
  <!-- options-end -->
  *
  * @param options the list of options as an array of strings
  * @throws Exception if an option is not supported
  */
 public void setOptions(String[] options) throws Exception {
   String debug = "(KStar.setOptions)";
   String blendStr = Utils.getOption('B', options);
   if (blendStr.length() != 0) {
     setGlobalBlend(Integer.parseInt(blendStr));
   }

   setEntropicAutoBlend(Utils.getFlag('E', options));
   
   String missingModeStr = Utils.getOption('M', options);
   if (missingModeStr.length() != 0) {
     switch ( missingModeStr.charAt(0) ) {
     case 'a':
setMissingMode(new SelectedTag(M_AVERAGE, TAGS_MISSING));
break;
     case 'd':
setMissingMode(new SelectedTag(M_DELETE, TAGS_MISSING));
break;
     case 'm':
setMissingMode(new SelectedTag(M_MAXDIFF, TAGS_MISSING));
break;
     case 'n':
setMissingMode(new SelectedTag(M_NORMAL, TAGS_MISSING));
break;
     default:
setMissingMode(new SelectedTag(M_AVERAGE, TAGS_MISSING));
     }
   }
   Utils.checkForRemainingOptions(options);
 }
 
源代码14 项目: tsml   文件: ADTree.java
/**
 * Sets the method of searching the tree for a new insertion. Will be one of
 * SEARCHPATH_ALL, SEARCHPATH_HEAVIEST, SEARCHPATH_ZPURE, SEARCHPATH_RANDOM.
 *
 * @param newMethod the new tree searching mode
 */
public void setSearchPath(SelectedTag newMethod) {
  
  if (newMethod.getTags() == TAGS_SEARCHPATH) {
    m_searchPath = newMethod.getSelectedTag().getID();
  }
}
 
源代码15 项目: tsml   文件: SortLabels.java
/**
  * Sets the sort type to be used.
  *
  * @param type 	the type of sorting
  */
 public void setSortType(SelectedTag type) {
   if (type.getTags() == TAGS_SORTTYPE) {
     m_SortType = type.getSelectedTag().getID();
     
     if (m_SortType == SORT_CASESENSITIVE)
m_Comparator = new CaseSensitiveComparator();
     else if (m_SortType == SORT_CASEINSENSITIVE)
m_Comparator = new CaseInsensitiveComparator();
     else
throw new IllegalStateException("Unhandled sort type '" + type + "'!");
   }
 }
 
源代码16 项目: tsml   文件: StringKernel.java
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -D
 *  Enables debugging output (if available) to be printed.
 *  (default: off)</pre>
 * 
 * <pre> -no-checks
 *  Turns off all checks - use with caution!
 *  (default: checks on)</pre>
 * 
 * <pre> -P &lt;0|1&gt;
 *  The pruning method to use:
 *  0 = No pruning
 *  1 = Lambda pruning
 *  (default: 0)</pre>
 * 
 * <pre> -C &lt;num&gt;
 *  The size of the cache (a prime number).
 *  (default: 250007)</pre>
 * 
 * <pre> -IC &lt;num&gt;
 *  The size of the internal cache (a prime number).
 *  (default: 200003)</pre>
 * 
 * <pre> -L &lt;num&gt;
 *  The lambda constant. Penalizes non-continuous subsequence
 *  matches. Must be in (0,1).
 *  (default: 0.5)</pre>
 * 
 * <pre> -ssl &lt;num&gt;
 *  The length of the subsequence.
 *  (default: 3)</pre>
 * 
 * <pre> -ssl-max &lt;num&gt;
 *  The maximum length of the subsequence.
 *  (default: 9)</pre>
 * 
 * <pre> -N
 *  Use normalization.
 *  (default: no)</pre>
 * 
 <!-- options-end -->
 * 
 * @param options 	the list of options as an array of strings
 * @throws Exception 	if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
  String	tmpStr;
  
  tmpStr = Utils.getOption('P', options);
  if (tmpStr.length() != 0)
    setPruningMethod(
 new SelectedTag(Integer.parseInt(tmpStr), TAGS_PRUNING));
  else
    setPruningMethod(
 new SelectedTag(PRUNING_NONE, TAGS_PRUNING));

  tmpStr = Utils.getOption('C', options);
  if (tmpStr.length() != 0)
    setCacheSize(Integer.parseInt(tmpStr));
  else
    setCacheSize(250007);
  
  tmpStr = Utils.getOption("IC", options);
  if (tmpStr.length() != 0)
    setInternalCacheSize(Integer.parseInt(tmpStr));
  else
    setInternalCacheSize(200003);
  
  tmpStr = Utils.getOption('L', options);
  if (tmpStr.length() != 0)
    setLambda(Double.parseDouble(tmpStr));
  else
    setLambda(0.5);
  
  tmpStr = Utils.getOption("ssl", options);
  if (tmpStr.length() != 0)
    setSubsequenceLength(Integer.parseInt(tmpStr));
  else
    setSubsequenceLength(3);
  
  tmpStr = Utils.getOption("ssl-max", options);
  if (tmpStr.length() != 0)
    setMaxSubsequenceLength(Integer.parseInt(tmpStr));
  else
    setMaxSubsequenceLength(9);

  setUseNormalization(Utils.getFlag('N', options));

  if (getMaxSubsequenceLength()<2*getSubsequenceLength()) {
    throw new IllegalArgumentException("Lambda Pruning forbids even contiguous substring matches! " +
    "Use a bigger value for ssl-max (at least 2*ssl).");
  }
  
  super.setOptions(options);
}
 
源代码17 项目: tsml   文件: SortLabels.java
/**
 * Parses the options for this object. <p/>
 *
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -D
 *  Turns on output of debugging information.</pre>
 * 
 * <pre> -R &lt;index1,index2-index4,...&gt;
 *  Specify list of string attributes to convert to words.
 *  (default: select all relational attributes)</pre>
 * 
 * <pre> -V
 *  Inverts the matching sense of the selection.</pre>
 * 
 * <pre> -S &lt;CASE|NON-CASE&gt;
 *  Determines the type of sorting:
 *  CASE = Case-sensitive
 *  NON-CASE = Case-insensitive
 *  (default: CASE)</pre>
 * 
 <!-- options-end -->
 *
 * @param options	the options to use
 * @throws Exception	if setting of options fails
 */
public void setOptions(String[] options) throws Exception {
  String	tmpStr;

  tmpStr = Utils.getOption('R', options);
  if (tmpStr.length() != 0)
    setAttributeIndices(tmpStr);
  else
    setAttributeIndices("first-last");

  setInvertSelection(Utils.getFlag('V', options));

  tmpStr = Utils.getOption('S', options);
  if (tmpStr.length() != 0)
    setSortType(new SelectedTag(tmpStr, TAGS_SORTTYPE));
  else
    setSortType(new SelectedTag(SORT_CASESENSITIVE, TAGS_SORTTYPE));

  super.setOptions(options);
}
 
源代码18 项目: tsml   文件: Add.java
/**
 * Sets the type of attribute to generate. 
 *
 * @param value 	the attribute type
 */
public void setAttributeType(SelectedTag value) {
  if (value.getTags() == TAGS_TYPE) {
    m_AttributeType = value.getSelectedTag().getID();
  }
}
 
源代码19 项目: tsml   文件: LinearForwardSelection.java
/**
 * Parses a given list of options.
 *
 * Valid options are:
 * <p>
 *
 * -P <start set> <br>
 * Specify a starting set of attributes. Eg 1,4,7-9.
 * <p>
 *
 * -D <0 = forward selection | 1 = floating forward selection> <br>
 * Forward selection method of the search. (default = 0).
 * <p>
 *
 * -N <num> <br>
 * Number of non improving nodes to consider before terminating search.
 * (default = 5).
 * <p>
 *
 * -I <br>
 * Perform initial ranking to select top-ranked attributes.
 * <p>
 *
 * -K <num> <br>
 * Number of top-ranked attributes that are taken into account.
 * <p>
 *
 * -T <0 = fixed-set | 1 = fixed-width> <br>
 * Typ of Linear Forward Selection (default = 0).
 * <p>
 *
 * -S <num> <br>
 * Size of lookup cache for evaluated subsets. Expressed as a multiple of
 * the number of attributes in the data set. (default = 1).
 * <p>
 *
 * -Z <br>
 * verbose on/off.
 * <p>
 *
 * @param options
 *            the list of options as an array of strings
 * @exception Exception
 *                if an option is not supported
 *
 */
public void setOptions(String[] options) throws Exception {
  String optionString;
  resetOptions();

  optionString = Utils.getOption('P', options);

  if (optionString.length() != 0) {
    setStartSet(optionString);
  }

  optionString = Utils.getOption('D', options);

  if (optionString.length() != 0) {
    setForwardSelectionMethod(new SelectedTag(Integer.parseInt(optionString),
                                              TAGS_SEARCH_METHOD));
  } else {
    setForwardSelectionMethod(new SelectedTag(SEARCH_METHOD_FORWARD,
                                              TAGS_SEARCH_METHOD));
  }

  optionString = Utils.getOption('N', options);

  if (optionString.length() != 0) {
    setSearchTermination(Integer.parseInt(optionString));
  }

  setPerformRanking(Utils.getFlag('I', options));

  optionString = Utils.getOption('K', options);

  if (optionString.length() != 0) {
    setNumUsedAttributes(Integer.parseInt(optionString));
  }

  optionString = Utils.getOption('T', options);

  if (optionString.length() != 0) {
    setType(new SelectedTag(Integer.parseInt(optionString), TAGS_TYPE));
  } else {
    setType(new SelectedTag(TYPE_FIXED_SET, TAGS_TYPE));
  }

  optionString = Utils.getOption('S', options);

  if (optionString.length() != 0) {
    setLookupCacheSize(Integer.parseInt(optionString));
  }

  m_verbose = Utils.getFlag('Z', options);
}
 
源代码20 项目: tsml   文件: PLSFilter.java
/**
 * Sets the type of algorithm to use 
 *
 * @param value 	the algorithm type
 */
public void setAlgorithm(SelectedTag value) {
  if (value.getTags() == TAGS_ALGORITHM) {
    m_Algorithm = value.getSelectedTag().getID();
  }
}
 
源代码21 项目: tsml   文件: ScatterSearchV1.java
/**
 * Set the kind of combination
 *
 * @param c the kind of combination of the search
 */
public void setCombination (SelectedTag c) {
  if (c.getTags() == TAGS_SELECTION) {
    m_typeOfCombination = c.getSelectedTag().getID();
  }
}
 
源代码22 项目: tsml   文件: Vote.java
/**
 * Parses a given list of options.
 * <p/>
 * 
 <!-- options-start --> 
 * Valid options are:
 * <p/>
 * 
 * <pre>
 * -S &lt;num&gt;
 *  Random number seed.
 *  (default 1)
 * </pre>
 * 
 * <pre>
 * -B &lt;classifier specification&gt;
 *  Full class name of classifier to include, followed
 *  by scheme options. May be specified multiple times.
 *  (default: "weka.classifiers.rules.ZeroR")
 * </pre>
 * 
 * <pre>
 * -D
 *  If set, classifier is run in debug mode and
 *  may output additional info to the console
 * </pre>
 * 
 * <pre>
 * -P &lt;path to serialized classifier&gt;
 *  Full path to serialized classifier to include.
 *  May be specified multiple times to include
 *  multiple serialized classifiers. Note: it does
 *  not make sense to use pre-built classifiers in
 *  a cross-validation.
 * </pre>
 * 
 * <pre>
 * -R &lt;AVG|PROD|MAJ|MIN|MAX|MED&gt;
 *  The combination rule to use
 *  (default: AVG)
 * </pre>
 * 
 <!-- options-end -->
 * 
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
@Override
public void setOptions(String[] options) throws Exception {
  String tmpStr;

  tmpStr = Utils.getOption('R', options);
  if (tmpStr.length() != 0)
    setCombinationRule(new SelectedTag(tmpStr, TAGS_RULES));
  else
    setCombinationRule(new SelectedTag(AVERAGE_RULE, TAGS_RULES));

  m_classifiersToLoad.clear();
  while (true) {
    String loadString = Utils.getOption('P', options);
    if (loadString.length() == 0) {
      break;
    }

    m_classifiersToLoad.add(loadString);
  }

  super.setOptions(options);
}
 
源代码23 项目: tsml   文件: Agrawal.java
/**
 * Parses a list of options for this object. <p/>
 *
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -h
 *  Prints this help.</pre>
 * 
 * <pre> -o &lt;file&gt;
 *  The name of the output file, otherwise the generated data is
 *  printed to stdout.</pre>
 * 
 * <pre> -r &lt;name&gt;
 *  The name of the relation.</pre>
 * 
 * <pre> -d
 *  Whether to print debug informations.</pre>
 * 
 * <pre> -S
 *  The seed for random function (default 1)</pre>
 * 
 * <pre> -n &lt;num&gt;
 *  The number of examples to generate (default 100)</pre>
 * 
 * <pre> -F &lt;num&gt;
 *  The function to use for generating the data. (default 1)</pre>
 * 
 * <pre> -B
 *  Whether to balance the class.</pre>
 * 
 * <pre> -P &lt;num&gt;
 *  The perturbation factor. (default 0.05)</pre>
 * 
 <!-- options-end -->
 *
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
  String        tmpStr;

  super.setOptions(options);

  tmpStr = Utils.getOption('F', options);
  if (tmpStr.length() != 0)
    setFunction(new SelectedTag(Integer.parseInt(tmpStr), FUNCTION_TAGS));
  else
    setFunction(defaultFunction());

  setBalanceClass(Utils.getFlag('B', options));

  tmpStr = Utils.getOption('P', options);
  if (tmpStr.length() != 0)
    setPerturbationFraction(Double.parseDouble(tmpStr));
  else
    setPerturbationFraction(defaultPerturbationFraction());
}
 
源代码24 项目: tsml   文件: LocalScoreSearchAlgorithm.java
/**
 * set quality measure to be used in searching for networks.
 * 
 * @param newScoreType the new score type
 */
public void setScoreType(SelectedTag newScoreType) {
	if (newScoreType.getTags() == TAGS_SCORE_TYPE) {
		m_nScoreType = newScoreType.getSelectedTag().getID();
	}
}
 
源代码25 项目: tsml   文件: LinearRegression.java
/**
 * Parses a given list of options. <p/>
 *
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -D
 *  Produce debugging output.
 *  (default no debugging output)</pre>
 * 
 * <pre> -S &lt;number of selection method&gt;
 *  Set the attribute selection method to use. 1 = None, 2 = Greedy.
 *  (default 0 = M5' method)</pre>
 * 
 * <pre> -C
 *  Do not try to eliminate colinear attributes.
 * </pre>
 * 
 * <pre> -R &lt;double&gt;
 *  Set ridge parameter (default 1.0e-8).
 * </pre>
 * 
 * <pre> -minimal
 *  Conserve memory, don't keep dataset header and means/stdevs.
 *  Model cannot be printed out if this option is enabled. (default: keep data)</pre>
 * 
 <!-- options-end -->
 *
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {

  String selectionString = Utils.getOption('S', options);
  if (selectionString.length() != 0) {
    setAttributeSelectionMethod(new SelectedTag(Integer
				  .parseInt(selectionString),
				  TAGS_SELECTION));
  } else {
    setAttributeSelectionMethod(new SelectedTag(SELECTION_M5,
				  TAGS_SELECTION));
  }
  String ridgeString = Utils.getOption('R', options);
  if (ridgeString.length() != 0) {
    setRidge(new Double(ridgeString).doubleValue());
  } else {
    setRidge(1.0e-8);
  }
  setDebug(Utils.getFlag('D', options));
  setEliminateColinearAttributes(!Utils.getFlag('C', options));
  setMinimal(Utils.getFlag("minimal", options));
}
 
源代码26 项目: tsml   文件: HoeffdingTree.java
/**
 * Set the split criterion to use (either Gini or info gain).
 * 
 * @param crit the criterion to use
 */
public void setSplitCriterion(SelectedTag crit) {
  if (crit.getTags() == TAGS_SELECTION) {
    m_selectedSplitMetric = crit.getSelectedTag().getID();
  }
}
 
源代码27 项目: tsml   文件: GaussianProcesses.java
/**
 * Sets how the training data will be transformed. Should be one of
 * FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.
 * 
 * @param newType
 *            the new filtering mode
 */
public void setFilterType(SelectedTag newType) {

  if (newType.getTags() == TAGS_FILTER) {
    m_filterType = newType.getSelectedTag().getID();
  }
}
 
源代码28 项目: tsml   文件: MISVM.java
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -D
 *  If set, classifier is run in debug mode and
 *  may output additional info to the console</pre>
 * 
 * <pre> -C &lt;double&gt;
 *  The complexity constant C. (default 1)</pre>
 * 
 * <pre> -N &lt;default 0&gt;
 *  Whether to 0=normalize/1=standardize/2=neither.
 *  (default: 0=normalize)</pre>
 * 
 * <pre> -I &lt;num&gt;
 *  The maximum number of iterations to perform.
 *  (default: 500)</pre>
 * 
 * <pre> -K &lt;classname and parameters&gt;
 *  The Kernel to use.
 *  (default: weka.classifiers.functions.supportVector.PolyKernel)</pre>
 * 
 * <pre> 
 * Options specific to kernel weka.classifiers.functions.supportVector.PolyKernel:
 * </pre>
 * 
 * <pre> -D
 *  Enables debugging output (if available) to be printed.
 *  (default: off)</pre>
 * 
 * <pre> -no-checks
 *  Turns off all checks - use with caution!
 *  (default: checks on)</pre>
 * 
 * <pre> -C &lt;num&gt;
 *  The size of the cache (a prime number), 0 for full cache and 
 *  -1 to turn it off.
 *  (default: 250007)</pre>
 * 
 * <pre> -E &lt;num&gt;
 *  The Exponent to use.
 *  (default: 1.0)</pre>
 * 
 * <pre> -L
 *  Use lower-order terms.
 *  (default: no)</pre>
 * 
 <!-- options-end -->
 * 
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
  String	tmpStr;
  String[]	tmpOptions;
  
  tmpStr = Utils.getOption('C', options);
  if (tmpStr.length() != 0)
    setC(Double.parseDouble(tmpStr));
  else
    setC(1.0);
  
  tmpStr = Utils.getOption('N', options);
  if (tmpStr.length() != 0)
    setFilterType(new SelectedTag(Integer.parseInt(tmpStr), TAGS_FILTER));
  else
    setFilterType(new SelectedTag(FILTER_NORMALIZE, TAGS_FILTER));

  tmpStr = Utils.getOption('I', options);
  if (tmpStr.length() != 0)
    setMaxIterations(Integer.parseInt(tmpStr));
  else
    setMaxIterations(500);
  
  tmpStr     = Utils.getOption('K', options);
  tmpOptions = Utils.splitOptions(tmpStr);
  if (tmpOptions.length != 0) {
    tmpStr        = tmpOptions[0];
    tmpOptions[0] = "";
    setKernel(Kernel.forName(tmpStr, tmpOptions));
  }
  
  super.setOptions(options);
}
 
源代码29 项目: tsml   文件: MultiInstanceToPropositional.java
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -A &lt;num&gt;
 *  The type of weight setting for each prop. instance:
 *  0.weight = original single bag weight /Total number of
 *  prop. instance in the corresponding bag;
 *  1.weight = 1.0;
 *  2.weight = 1.0/Total number of prop. instance in the 
 *   corresponding bag; 
 *  3. weight = Total number of prop. instance / (Total number 
 *   of bags * Total number of prop. instance in the 
 *   corresponding bag). 
 *  (default:0)</pre>
 * 
 <!-- options-end -->
 *
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
public void setOptions(String[] options) throws Exception {
  String weightString = Utils.getOption('A', options);
  if (weightString.length() != 0) {
    setWeightMethod(
        new SelectedTag(Integer.parseInt(weightString), TAGS_WEIGHTMETHOD));
  } else {
    setWeightMethod(
        new SelectedTag(WEIGHTMETHOD_INVERSE2, TAGS_WEIGHTMETHOD));
  }	
}
 
源代码30 项目: tsml   文件: MIDD.java
/**
 * Parses a given list of options. <p/>
 *     
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -D
 *  Turn on debugging output.</pre>
 * 
 * <pre> -N &lt;num&gt;
 *  Whether to 0=normalize/1=standardize/2=neither.
 *  (default 1=standardize)</pre>
 * 
 <!-- options-end -->
 *
 * @param options the list of options as an array of strings
 * @throws Exception if an option is not supported
 */
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_STANDARDIZE, TAGS_FILTER));
  }     
}