当前位置: 首页>>代码示例>>Java>>正文


Java AttributeSelection.selectedAttributes方法代码示例

本文整理汇总了Java中weka.attributeSelection.AttributeSelection.selectedAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeSelection.selectedAttributes方法的具体用法?Java AttributeSelection.selectedAttributes怎么用?Java AttributeSelection.selectedAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在weka.attributeSelection.AttributeSelection的用法示例。


在下文中一共展示了AttributeSelection.selectedAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: featureSelection

import weka.attributeSelection.AttributeSelection; //导入方法依赖的package包/类
/**
 * Method featureSelection, which uses an algorithm to select the most representative features of
 * the data in patterns_krs table
 *
 * @param data The instances from patterns_krs table
 *
 * @return indexes The indexes of the attributes selected by the algorithm
 */
   
public int[] featureSelection(Instances data){
   
    int[] indexes = null;
    AttributeSelection attsel = new AttributeSelection();
    //FuzzyRoughSubsetEval eval = new FuzzyRoughSubsetEval();
    //HillClimber search = new HillClimber();
    CfsSubsetEval eval = new CfsSubsetEval();
    GreedyStepwise search = new GreedyStepwise();
    attsel.setEvaluator(eval);
    attsel.setSearch(search);
    try {
        attsel.SelectAttributes(data);
        indexes = attsel.selectedAttributes();
        logger.info("Selected Features: "+Utils.arrayToString(indexes));
    } catch (Exception e) {
        e.printStackTrace();
    }
   
    return indexes;
   
}
 
开发者ID:MusesProject,项目名称:MusesServer,代码行数:31,代码来源:DataMiner.java

示例2: selectFeatures

import weka.attributeSelection.AttributeSelection; //导入方法依赖的package包/类
public void selectFeatures(){
	AttributeSelection attSelection = new AttributeSelection();
    CfsSubsetEval eval = new CfsSubsetEval();
    BestFirst search = new BestFirst();
    attSelection.setEvaluator(eval);
    attSelection.setSearch(search);
    try {
		attSelection.SelectAttributes(iris);
		int[] attIndex = attSelection.selectedAttributes();
		System.out.println(Utils.arrayToString(attIndex));
	} catch (Exception e) {
	}
}
 
开发者ID:PacktPublishing,项目名称:Java-Data-Science-Cookbook,代码行数:14,代码来源:WekaFeatureSelectionTest.java

示例3: useLowLevel

import weka.attributeSelection.AttributeSelection; //导入方法依赖的package包/类
/**
 * uses the low level approach
 */
protected static void useLowLevel(Instances data) throws Exception {
    System.out.println("\n3. Low-level");
    AttributeSelection attsel = new AttributeSelection();
    attsel.SelectAttributes(data);
    int[] indices = attsel.selectedAttributes();
    for (int i = 0; i < indices.length; i++) {
        System.out.println(data.attribute(i).toString());
    }
}
 
开发者ID:ajaybhat,项目名称:Essay-Grading-System,代码行数:13,代码来源:AttributeSelectionRunner.java


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