weka.core.SelectedTag Java Examples

The following examples show how to use weka.core.SelectedTag. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Apriori.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
  }
}
 
Example #2
Source File: ADTree.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
  * 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);
 }
 
Example #3
Source File: LinearRegression.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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();
  }
}
 
Example #4
Source File: KStar.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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();
  }
}
 
Example #5
Source File: KStar.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
  * 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);
 }
 
Example #6
Source File: ADTree.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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();
  }
}
 
Example #7
Source File: BestFirst.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #8
Source File: PaceRegression.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets the estimator.
 *
 * @param estimator the new estimator
 */
public void setEstimator(SelectedTag estimator) {
  
  if (estimator.getTags() == TAGS_ESTIMATOR) {
    paceEstimator = estimator.getSelectedTag().getID();
  }
}
 
Example #9
Source File: SMO.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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();
  }
}
 
Example #10
Source File: RandomProjection.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #11
Source File: CostSensitiveClassifier.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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();
  }
}
 
Example #12
Source File: ScatterSearchV1.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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));
}
 
Example #13
Source File: MIDD.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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();
  }
}
 
Example #14
Source File: SortLabels.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
  * 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 + "'!");
   }
 }
 
Example #15
Source File: FPGrowth.java    From tsml with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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;
    }
  }
}
 
Example #16
Source File: Vote.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}
 
Example #17
Source File: Agrawal.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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());
}
 
Example #18
Source File: LinearRegression.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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));
}
 
Example #19
Source File: StringKernel.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}
 
Example #20
Source File: HoeffdingTree.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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();
  }
}
 
Example #21
Source File: LinearForwardSelection.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}
 
Example #22
Source File: Add.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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();
  }
}
 
Example #23
Source File: LocalScoreSearchAlgorithm.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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();
	}
}
 
Example #24
Source File: PLSFilter.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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();
  }
}
 
Example #25
Source File: SortLabels.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}
 
Example #26
Source File: ScatterSearchV1.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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();
  }
}
 
Example #27
Source File: SGD.java    From tsml with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 
 * Parses a given list of options.
 * <p/>
 * 
 <!-- options-start --> 
 * Valid options are:
 * <p/>
 * 
 * <pre>
 * -F
 *  Set the loss function to minimize. 0 = hinge loss (SVM), 1 = log loss (logistic regression),
 *  2 = squared loss (regression).
 *  (default = 0)
 * </pre>
 * 
 * <pre>
 * -L
 *  The learning rate. If normalization is
 *  turned off (as it is automatically for streaming data), then the
 *  default learning rate will need to be reduced (try 0.0001).
 *  (default = 0.01).
 * </pre>
 * 
 * <pre>
 * -R &lt;double&gt;
 *  The lambda regularization constant (default = 0.0001)
 * </pre>
 * 
 * <pre>
 * -E &lt;integer&gt;
 *  The number of epochs to perform (batch learning only, default = 500)
 * </pre>
 * 
 * <pre>
 * -C &lt;double&gt;
 *  The epsilon threshold (epsilon-insenstive and Huber loss only, default = 1e-3)
 * </pre>
 * 
 * <pre>
 * -N
 *  Don't normalize the data
 * </pre>
 * 
 * <pre>
 * -M
 *  Don't replace missing values
 * </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 {
  reset();

  super.setOptions(options);

  String lossString = Utils.getOption('F', options);
  if (lossString.length() != 0) {
    setLossFunction(new SelectedTag(Integer.parseInt(lossString),
        TAGS_SELECTION));
  }

  String lambdaString = Utils.getOption('R', options);
  if (lambdaString.length() > 0) {
    setLambda(Double.parseDouble(lambdaString));
  }

  String learningRateString = Utils.getOption('L', options);
  if (learningRateString.length() > 0) {
    setLearningRate(Double.parseDouble(learningRateString));
  }

  String epochsString = Utils.getOption("E", options);
  if (epochsString.length() > 0) {
    setEpochs(Integer.parseInt(epochsString));
  }

  String epsilonString = Utils.getOption("C", options);
  if (epsilonString.length() > 0) {
    setEpsilon(Double.parseDouble(epsilonString));
  }

  setDontNormalize(Utils.getFlag("N", options));
  setDontReplaceMissing(Utils.getFlag('M', options));
}
 
Example #28
Source File: MIDD.java    From tsml with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 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));
  }     
}
 
Example #29
Source File: PLSFilter.java    From tsml with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Parses the options for this object. <p/>
 *
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -D
 *  Turns on output of debugging information.</pre>
 * 
 * <pre> -C &lt;num&gt;
 *  The number of components to compute.
 *  (default: 20)</pre>
 * 
 * <pre> -U
 *  Updates the class attribute as well.
 *  (default: off)</pre>
 * 
 * <pre> -M
 *  Turns replacing of missing values on.
 *  (default: off)</pre>
 * 
 * <pre> -A &lt;SIMPLS|PLS1&gt;
 *  The algorithm to use.
 *  (default: PLS1)</pre>
 * 
 * <pre> -P &lt;none|center|standardize&gt;
 *  The type of preprocessing that is applied to the data.
 *  (default: center)</pre>
 * 
 <!-- options-end -->
 *
 * @param options	the options to use
 * @throws Exception	if the option setting fails
 */
public void setOptions(String[] options) throws Exception {
  String	tmpStr;

  super.setOptions(options);

  tmpStr = Utils.getOption("C", options);
  if (tmpStr.length() != 0)
    setNumComponents(Integer.parseInt(tmpStr));
  else
    setNumComponents(20);

  setPerformPrediction(Utils.getFlag("U", options));
  
  setReplaceMissing(Utils.getFlag("M", options));
  
  tmpStr = Utils.getOption("A", options);
  if (tmpStr.length() != 0)
    setAlgorithm(new SelectedTag(tmpStr, TAGS_ALGORITHM));
  else
    setAlgorithm(new SelectedTag(ALGORITHM_PLS1, TAGS_ALGORITHM));
  
  tmpStr = Utils.getOption("P", options);
  if (tmpStr.length() != 0)
    setPreprocessing(new SelectedTag(tmpStr, TAGS_PREPROCESSING));
  else
    setPreprocessing(new SelectedTag(PREPROCESSING_CENTER, TAGS_PREPROCESSING));
}
 
Example #30
Source File: GaussianProcesses.java    From tsml with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 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();
  }
}