• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LinearNNSearch类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中weka.core.neighboursearch.LinearNNSearch的典型用法代码示例。如果您正苦于以下问题:Java LinearNNSearch类的具体用法?Java LinearNNSearch怎么用?Java LinearNNSearch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LinearNNSearch类属于weka.core.neighboursearch包,在下文中一共展示了LinearNNSearch类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setOptions

import weka.core.neighboursearch.LinearNNSearch; //导入依赖的package包/类
/**
 * Parses a given list of options.
 * <p/>
 * 
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -min &lt;num&gt;
 *  Lower bound on the k nearest neighbors for finding max LOF (minPtsLB)
 *  (default = 10)</pre>
 * 
 * <pre> -max &lt;num&gt;
 *  Upper bound on the k nearest neighbors for finding max LOF (minPtsUB)
 *  (default = 40)</pre>
 * 
 * <pre> -A
 *  The nearest neighbour search algorithm to use (default: weka.core.neighboursearch.LinearNNSearch).
 * </pre>
 * 
 * <pre> -num-slots &lt;num&gt;
 *  Number of execution slots.
 *  (default 1 - i.e. no parallelism)</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 minP = Utils.getOption("min", options);
  if (minP.length() > 0) {
    setMinPointsLowerBound(minP);
  }

  String maxP = Utils.getOption("max", options);
  if (maxP.length() > 0) {
    setMinPointsUpperBound(maxP);
  }

  String nnSearchClass = Utils.getOption('A', options);
  if (nnSearchClass.length() != 0) {
    String nnSearchClassSpec[] = Utils.splitOptions(nnSearchClass);
    if (nnSearchClassSpec.length == 0) {
      throw new Exception("Invalid NearestNeighbourSearch algorithm "
          + "specification string.");
    }
    String className = nnSearchClassSpec[0];
    nnSearchClassSpec[0] = "";

    setNNSearch((NearestNeighbourSearch) Utils.forName(
        NearestNeighbourSearch.class, className, nnSearchClassSpec));
  } else {
    this.setNNSearch(new LinearNNSearch());
  }

  String slotsS = Utils.getOption("num-slots", options);
  if (slotsS.length() > 0) {
    setNumExecutionSlots(slotsS);
  }

  Utils.checkForRemainingOptions(options);
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:64,代码来源:LOF.java


示例2: setOptions

import weka.core.neighboursearch.LinearNNSearch; //导入依赖的package包/类
/**
 * Parses a given list of options. <p/>
 *
 <!-- options-start -->
 * Valid options are: <p/>
 * 
 * <pre> -A
 *  The nearest neighbour search algorithm to use (default: weka.core.neighboursearch.LinearNNSearch).
 * </pre>
 * 
 * <pre> -K &lt;number of neighbours&gt;
 *  Set the number of neighbours used to set the kernel bandwidth.
 *  (default all)</pre>
 * 
 * <pre> -U &lt;number of weighting method&gt;
 *  Set the weighting kernel shape to use. 0=Linear, 1=Epanechnikov,
 *  2=Tricube, 3=Inverse, 4=Gaussian.
 *  (default 0 = Linear)</pre>
 * 
 * <pre> -D
 *  If set, classifier is run in debug mode and
 *  may output additional info to the console</pre>
 * 
 * <pre> -W
 *  Full name of base classifier.
 *  (default: weka.classifiers.trees.DecisionStump)</pre>
 * 
 * <pre> 
 * Options specific to classifier weka.classifiers.trees.DecisionStump:
 * </pre>
 * 
 * <pre> -D
 *  If set, classifier is run in debug mode and
 *  may output additional info to the console</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 knnString = Utils.getOption('K', options);
  if (knnString.length() != 0) {
    setKNN(Integer.parseInt(knnString));
  } else {
    setKNN(-1);
  }

  String weightString = Utils.getOption('U', options);
  if (weightString.length() != 0) {
    setWeightingKernel(Integer.parseInt(weightString));
  } else {
    setWeightingKernel(LINEAR);
  }
  
  String nnSearchClass = Utils.getOption('A', options);
  if(nnSearchClass.length() != 0) {
    String nnSearchClassSpec[] = Utils.splitOptions(nnSearchClass);
    if(nnSearchClassSpec.length == 0) { 
      throw new Exception("Invalid NearestNeighbourSearch algorithm " +
                          "specification string."); 
    }
    String className = nnSearchClassSpec[0];
    nnSearchClassSpec[0] = "";

    setNearestNeighbourSearchAlgorithm( (NearestNeighbourSearch)
                Utils.forName( NearestNeighbourSearch.class, 
                               className, 
                               nnSearchClassSpec)
                                      );
  }
  else 
    this.setNearestNeighbourSearchAlgorithm(new LinearNNSearch());

  super.setOptions(options);
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:78,代码来源:LWL.java


示例3: setOptions

import weka.core.neighboursearch.LinearNNSearch; //导入依赖的package包/类
/**
 * Parses a given list of options.
 * <p/>
 * 
 <!-- options-start --> 
 * Valid options are:
 * <p/>
 * 
 * <pre>
 * -min &lt;num&gt;
 *  Lower bound on the k nearest neighbors for finding max LOF (minPtsLB)
 *  (default = 10)
 * </pre>
 * 
 * <pre>
 * -max &lt;num&gt;
 *  Upper bound on the k nearest neighbors for finding max LOF (minPtsUB)
 *  (default = 40)
 * </pre>
 * 
 * <pre>
 * -A
 *  The nearest neighbour search algorithm to use (default: weka.core.neighboursearch.LinearNNSearch).
 * </pre>
 * 
 * <pre>
 * -num-slots &lt;num&gt;
 *  Number of execution slots.
 *  (default 1 - i.e. no parallelism)
 * </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 minP = Utils.getOption("min", options);
  if (minP.length() > 0) {
    setMinPointsLowerBound(minP);
  }

  String maxP = Utils.getOption("max", options);
  if (maxP.length() > 0) {
    setMinPointsUpperBound(maxP);
  }

  String nnSearchClass = Utils.getOption('A', options);
  if (nnSearchClass.length() != 0) {
    String nnSearchClassSpec[] = Utils.splitOptions(nnSearchClass);
    if (nnSearchClassSpec.length == 0) {
      throw new Exception("Invalid NearestNeighbourSearch algorithm "
          + "specification string.");
    }
    String className = nnSearchClassSpec[0];
    nnSearchClassSpec[0] = "";

    setNNSearch((NearestNeighbourSearch) Utils.forName(
        NearestNeighbourSearch.class, className, nnSearchClassSpec));
  } else {
    this.setNNSearch(new LinearNNSearch());
  }

  String slotsS = Utils.getOption("num-slots", options);
  if (slotsS.length() > 0) {
    setNumExecutionSlots(slotsS);
  }

  Utils.checkForRemainingOptions(options);
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:72,代码来源:LOF.java


示例4: getDefaultSearch

import weka.core.neighboursearch.LinearNNSearch; //导入依赖的package包/类
/**
 * Returns the default nearest neighbor search to use.
 *
 * @return		the default
 */
protected NearestNeighbourSearch getDefaultSearch() {
  return new LinearNNSearch();
}
 
开发者ID:fracpete,项目名称:missing-values-imputation-weka-package,代码行数:9,代码来源:SimpleNearestNeighbor.java



注:本文中的weka.core.neighboursearch.LinearNNSearch类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CameraControl类代码示例发布时间:2022-05-22
下一篇:
Java OAuth2Version类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap