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


Java ASEvaluation类代码示例

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


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

示例1: calculate

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * Calculate metric value
 * 
 * @param mlData Multi-label dataset to which calculate the metric
 * @return Value of the metric
 */
public double calculate(MultiLabelInstances mlData){
	double res = 0.0;
       
       try{
           ASEvaluation ase = new InfoGainAttributeEval();
       
           BinaryRelevanceAttributeEvaluator eval = new BinaryRelevanceAttributeEvaluator(ase, mlData, "avg", "none", "eval");

           int [] featureIndices = mlData.getFeatureIndices();

           for(int i : featureIndices){
               res += eval.evaluateAttribute(i);
           }

           res = res / featureIndices.length;
       }
       catch(Exception e){
           e.printStackTrace();
       	res = Double.NaN;
       }
	
	this.value = res;
	return value;
}
 
开发者ID:i02momuj,项目名称:MLDA,代码行数:31,代码来源:AvgGainRatio.java

示例2: AttributeFilter

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
private AttributeFilter(Class<? extends ASEvaluation> evalClazz, String evalConfig, Class<? extends ASSearch> searchClazz, String searchConfig)
{
    this.evalClazz = evalClazz;
    this.evalConfig = evalConfig;
    this.searchClazz = searchClazz;
    this.searchConfig = searchConfig;
}
 
开发者ID:marcelovca90,项目名称:anti-spam-weka-gui,代码行数:8,代码来源:FilterConfiguration.java

示例3: buildAttributeFilterFor

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
private static Filter buildAttributeFilterFor(AttributeFilter attributeFilter, Instances dataSet) throws Exception
{
    ASEvaluation evaluator = attributeFilter.getEvalClazz().newInstance();
    ((OptionHandler) evaluator).setOptions(Utils.splitOptions(attributeFilter.getEvalConfig()));

    ASSearch search = attributeFilter.getSearchClazz().newInstance();
    ((OptionHandler) search).setOptions(Utils.splitOptions(attributeFilter.getSearchConfig()));

    Filter filter = new AttributeSelection();
    filter.setInputFormat(dataSet);
    ((AttributeSelection) filter).setEvaluator(evaluator);
    ((AttributeSelection) filter).setSearch(search);

    return filter;
}
 
开发者ID:marcelovca90,项目名称:anti-spam-weka-gui,代码行数:16,代码来源:FilterConfiguration.java

示例4: getEvaluatorSpec

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
  * Gets the evaluator specification string, which contains the class name of
  * the attribute evaluator and any options to it
  *
  * @return the evaluator string.
  */
 protected String getEvaluatorSpec() {
   
   ASEvaluation e = getEvaluator();
   if (e instanceof OptionHandler) {
     return e.getClass().getName() + " "
+ Utils.joinOptions(((OptionHandler)e).getOptions());
   }
   return e.getClass().getName();
 }
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:16,代码来源:AttributeSelectedClassifier.java

示例5: getFilter

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/** Creates a specialized AttributeSelection */
public Filter getFilter(ASEvaluation evaluator, ASSearch search) {
  
  AttributeSelection af = new AttributeSelection();
  if (evaluator != null) {
    af.setEvaluator(evaluator);
  }
  if (search != null) {
    af.setSearch(search);
  }
  return af;
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:13,代码来源:AttributeSelectionTest.java

示例6: WekaAttributeSelection

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
public WekaAttributeSelection(ASEvaluation evaluator,
		ASSearch searcher) {
	this.attrsel = new AttributeSelection();
	this.evaluator = evaluator;
	this.Searcher = searcher;
	this.attreval = (AttributeEvaluator) evaluator;
}
 
开发者ID:eracle,项目名称:gap,代码行数:8,代码来源:WekaAttributeSelection.java

示例7: selectAttributes

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
@TimeThis(task="select-attributes")
protected String selectAttributes(@SuppressWarnings("unused") ProcessingContext<Corpus> ctx, IdentifiedInstances<Element> trainingSet) throws Exception {
	ASEvaluation eval = ASEvaluation.forName(evaluator, evaluatorOptions);
	return AttributeSelection.SelectAttributes(eval, getEvalOptions(), trainingSet);
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:6,代码来源:WekaSelectAttributes.java

示例8: getEvalClazz

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
public Class<? extends ASEvaluation> getEvalClazz()
{
    return evalClazz;
}
 
开发者ID:marcelovca90,项目名称:anti-spam-weka-gui,代码行数:5,代码来源:FilterConfiguration.java

示例9: updateCapabilitiesFilter

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_AttributeEvaluatorEditor.setCapabilitiesFilter(new Capabilities(null));
    m_AttributeSearchEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  int clIndex = m_ClassCombo.getSelectedIndex() - 1;

  if (clIndex >= 0) {
    tempInst.setClassIndex(clIndex);
  }

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_AttributeEvaluatorEditor.setCapabilitiesFilter(filterClass);
  m_AttributeSearchEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // check capabilities...
  Capabilities currentFilter = m_AttributeEvaluatorEditor
      .getCapabilitiesFilter();
  ASEvaluation evaluator = (ASEvaluation) m_AttributeEvaluatorEditor
      .getValue();
  Capabilities currentSchemeCapabilities = null;
  if (evaluator != null && currentFilter != null
      && (evaluator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) evaluator)
        .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
        && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:54,代码来源:AttributeSelectionPanel.java

示例10: updateCapabilitiesFilter

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_AttributeEvaluatorEditor.setCapabilitiesFilter(new Capabilities(null));
    m_AttributeSearchEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter()) {
    tempInst = new Instances(m_Instances, 0);
  } else {
    tempInst = new Instances(m_Instances);
  }
  int clIndex = m_ClassCombo.getSelectedIndex() - 1;

  if (clIndex >= 0) {
    tempInst.setClassIndex(clIndex);
  }

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_AttributeEvaluatorEditor.setCapabilitiesFilter(filterClass);
  m_AttributeSearchEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // check capabilities...
  Capabilities currentFilter = m_AttributeEvaluatorEditor
    .getCapabilitiesFilter();
  ASEvaluation evaluator = (ASEvaluation) m_AttributeEvaluatorEditor
    .getValue();
  Capabilities currentSchemeCapabilities = null;
  if (evaluator != null && currentFilter != null
    && (evaluator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) evaluator)
      .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
      && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
 
开发者ID:umple,项目名称:umple,代码行数:55,代码来源:AttributeSelectionPanel.java

示例11: updateCapabilitiesFilter

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter	the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances 		tempInst;
  Capabilities 	filterClass;

  if (filter == null) {
    m_AttributeEvaluatorEditor.setCapabilitiesFilter(new Capabilities(null));
    m_AttributeSearchEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }
  
  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  int clIndex = m_ClassCombo.getSelectedIndex() - 1;
  
  if (clIndex >= 0) {
    tempInst.setClassIndex(clIndex);
  }        

  try {
    filterClass = Capabilities.forInstances(tempInst);
  }
  catch (Exception e) {
    filterClass = new Capabilities(null);
  }
  
  // set new filter
  m_AttributeEvaluatorEditor.setCapabilitiesFilter(filterClass);
  m_AttributeSearchEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // check capabilities...
  Capabilities currentFilter = m_AttributeEvaluatorEditor.getCapabilitiesFilter();
  ASEvaluation evaluator = (ASEvaluation) m_AttributeEvaluatorEditor.getValue();
  Capabilities currentSchemeCapabilities =  null;
  if (evaluator != null && currentFilter != null && 
      (evaluator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler)evaluator).getCapabilities();
        
    if (!currentSchemeCapabilities.supportsMaybe(currentFilter) &&
        !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
 
开发者ID:williamClanton,项目名称:jbossBA,代码行数:52,代码来源:AttributeSelectionPanel.java

示例12: setEvaluator

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * Sets the attribute evaluator
 *
 * @param evaluator the evaluator with all options set.
 */
public void setEvaluator(ASEvaluation evaluator) {
  m_Evaluator = evaluator;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:9,代码来源:AttributeSelectedClassifier.java

示例13: getEvaluator

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * Gets the attribute evaluator used
 *
 * @return the attribute evaluator
 */
public ASEvaluation getEvaluator() {
  return m_Evaluator;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:9,代码来源:AttributeSelectedClassifier.java

示例14: setEvaluator

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * set attribute/subset evaluator
 * 
 * @param evaluator the evaluator to use
 */
public void setEvaluator(ASEvaluation evaluator) {
  m_ASEvaluator = evaluator;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:9,代码来源:AttributeSelection.java

示例15: getEvaluator

import weka.attributeSelection.ASEvaluation; //导入依赖的package包/类
/**
 * Get the name of the attribute/subset evaluator
 * 
 * @return the name of the attribute/subset evaluator as a string
 */
public ASEvaluation getEvaluator() {

  return m_ASEvaluator;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:10,代码来源:AttributeSelection.java


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