Java Code Examples for weka.core.neighboursearch.kdtrees.SlidingMidPointOfWidestSide

The following are top voted examples for showing how to use weka.core.neighboursearch.kdtrees.SlidingMidPointOfWidestSide. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: repo.kmeanspp.silhouette_score   File: KDTree.java   Source Code and License 5 votes vote down vote up
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -S &lt;classname and options&gt;
 *  Node splitting method to use.
 *  (default: weka.core.neighboursearch.kdtrees.SlidingMidPointOfWidestSide)</pre>
 * 
 * <pre> -W &lt;value&gt;
 *  Set minimal width of a box
 *  (default: 1.0E-2).</pre>
 * 
 * <pre> -L
 *  Maximal number of instances in a leaf
 *  (default: 40).</pre>
 * 
 * <pre> -N
 *  Normalizing will be done
 *  (Select dimension for split, with normalising to universe).</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 {
  super.setOptions(options);

  String optionString = Utils.getOption('S', options);
  if (optionString.length() != 0) {
    String splitMethodSpec[] = Utils.splitOptions(optionString);
    if (splitMethodSpec.length == 0) {
      throw new Exception("Invalid DistanceFunction specification string.");
    }
    String className = splitMethodSpec[0];
    splitMethodSpec[0] = "";

    setNodeSplitter((KDTreeNodeSplitter) Utils.forName(
        KDTreeNodeSplitter.class, className, splitMethodSpec));
  }
  else {
    setNodeSplitter(new SlidingMidPointOfWidestSide());
  }

  optionString = Utils.getOption('W', options);
  if (optionString.length() != 0)
    setMinBoxRelWidth(Double.parseDouble(optionString));
  else
    setMinBoxRelWidth(1.0E-2);

  optionString = Utils.getOption('L', options);
  if (optionString.length() != 0)
    setMaxInstInLeaf(Integer.parseInt(optionString));
  else
    setMaxInstInLeaf(40);

  setNormalizeNodeWidth(Utils.getFlag('N', options));
  
  Utils.checkForRemainingOptions(options);
}
 
Example 2
Project: autoweka   File: KDTree.java   Source Code and License 5 votes vote down vote up
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -S &lt;classname and options&gt;
 *  Node splitting method to use.
 *  (default: weka.core.neighboursearch.kdtrees.SlidingMidPointOfWidestSide)</pre>
 * 
 * <pre> -W &lt;value&gt;
 *  Set minimal width of a box
 *  (default: 1.0E-2).</pre>
 * 
 * <pre> -L
 *  Maximal number of instances in a leaf
 *  (default: 40).</pre>
 * 
 * <pre> -N
 *  Normalizing will be done
 *  (Select dimension for split, with normalising to universe).</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 {
  super.setOptions(options);

  String optionString = Utils.getOption('S', options);
  if (optionString.length() != 0) {
    String splitMethodSpec[] = Utils.splitOptions(optionString);
    if (splitMethodSpec.length == 0) {
      throw new Exception("Invalid DistanceFunction specification string.");
    }
    String className = splitMethodSpec[0];
    splitMethodSpec[0] = "";

    setNodeSplitter((KDTreeNodeSplitter) Utils.forName(
        KDTreeNodeSplitter.class, className, splitMethodSpec));
  }
  else {
    setNodeSplitter(new SlidingMidPointOfWidestSide());
  }

  optionString = Utils.getOption('W', options);
  if (optionString.length() != 0)
    setMinBoxRelWidth(Double.parseDouble(optionString));
  else
    setMinBoxRelWidth(1.0E-2);

  optionString = Utils.getOption('L', options);
  if (optionString.length() != 0)
    setMaxInstInLeaf(Integer.parseInt(optionString));
  else
    setMaxInstInLeaf(40);

  setNormalizeNodeWidth(Utils.getFlag('N', options));
}
 
Example 3
Project: umple   File: KDTree.java   Source Code and License 5 votes vote down vote up
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -S &lt;classname and options&gt;
 *  Node splitting method to use.
 *  (default: weka.core.neighboursearch.kdtrees.SlidingMidPointOfWidestSide)</pre>
 * 
 * <pre> -W &lt;value&gt;
 *  Set minimal width of a box
 *  (default: 1.0E-2).</pre>
 * 
 * <pre> -L
 *  Maximal number of instances in a leaf
 *  (default: 40).</pre>
 * 
 * <pre> -N
 *  Normalizing will be done
 *  (Select dimension for split, with normalising to universe).</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 {
  super.setOptions(options);

  String optionString = Utils.getOption('S', options);
  if (optionString.length() != 0) {
    String splitMethodSpec[] = Utils.splitOptions(optionString);
    if (splitMethodSpec.length == 0) {
      throw new Exception("Invalid DistanceFunction specification string.");
    }
    String className = splitMethodSpec[0];
    splitMethodSpec[0] = "";

    setNodeSplitter((KDTreeNodeSplitter) Utils.forName(
        KDTreeNodeSplitter.class, className, splitMethodSpec));
  }
  else {
    setNodeSplitter(new SlidingMidPointOfWidestSide());
  }

  optionString = Utils.getOption('W', options);
  if (optionString.length() != 0)
    setMinBoxRelWidth(Double.parseDouble(optionString));
  else
    setMinBoxRelWidth(1.0E-2);

  optionString = Utils.getOption('L', options);
  if (optionString.length() != 0)
    setMaxInstInLeaf(Integer.parseInt(optionString));
  else
    setMaxInstInLeaf(40);

  setNormalizeNodeWidth(Utils.getFlag('N', options));
  
  Utils.checkForRemainingOptions(options);
}
 
Example 4
Project: jbossBA   File: KDTree.java   Source Code and License 5 votes vote down vote up
/**
 * Parses a given list of options. <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -S &lt;classname and options&gt;
 *  Node splitting method to use.
 *  (default: weka.core.neighboursearch.kdtrees.SlidingMidPointOfWidestSide)</pre>
 * 
 * <pre> -W &lt;value&gt;
 *  Set minimal width of a box
 *  (default: 1.0E-2).</pre>
 * 
 * <pre> -L
 *  Maximal number of instances in a leaf
 *  (default: 40).</pre>
 * 
 * <pre> -N
 *  Normalizing will be done
 *  (Select dimension for split, with normalising to universe).</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 {
  super.setOptions(options);

  String optionString = Utils.getOption('S', options);
  if (optionString.length() != 0) {
    String splitMethodSpec[] = Utils.splitOptions(optionString);
    if (splitMethodSpec.length == 0) {
      throw new Exception("Invalid DistanceFunction specification string.");
    }
    String className = splitMethodSpec[0];
    splitMethodSpec[0] = "";

    setNodeSplitter((KDTreeNodeSplitter) Utils.forName(
        KDTreeNodeSplitter.class, className, splitMethodSpec));
  }
  else {
    setNodeSplitter(new SlidingMidPointOfWidestSide());
  }

  optionString = Utils.getOption('W', options);
  if (optionString.length() != 0)
    setMinBoxRelWidth(Double.parseDouble(optionString));
  else
    setMinBoxRelWidth(1.0E-2);

  optionString = Utils.getOption('L', options);
  if (optionString.length() != 0)
    setMaxInstInLeaf(Integer.parseInt(optionString));
  else
    setMaxInstInLeaf(40);

  setNormalizeNodeWidth(Utils.getFlag('N', options));
}