weka.classifiers.bayes.NaiveBayes.getUseSupervisedDiscretization()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中weka.classifiers.bayes.NaiveBayes.getUseSupervisedDiscretization()方法的一些代码示例,展示了NaiveBayes.getUseSupervisedDiscretization()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NaiveBayes.getUseSupervisedDiscretization()方法的具体详情如下:
包路径:weka.classifiers.bayes.NaiveBayes
类名称:NaiveBayes
方法名:getUseSupervisedDiscretization

NaiveBayes.getUseSupervisedDiscretization介绍

[英]Get whether supervised discretization is to be used.
[中]获取是否使用监督离散化。

代码示例

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public NaiveBayes aggregate(NaiveBayes toAggregate) throws Exception {
 // Highly unlikely that discretization intervals will match between the
 // two classifiers
 if (m_UseDiscretization || toAggregate.getUseSupervisedDiscretization()) {
  throw new Exception("Unable to aggregate when supervised discretization "
   + "has been turned on");
 }
 if (!m_Instances.equalHeaders(toAggregate.m_Instances)) {
  throw new Exception("Can't aggregate - data headers don't match: "
   + m_Instances.equalHeadersMsg(toAggregate.m_Instances));
 }
 ((Aggregateable) m_ClassDistribution)
  .aggregate(toAggregate.m_ClassDistribution);
 // aggregate all conditional estimators
 for (int i = 0; i < m_Distributions.length; i++) {
  for (int j = 0; j < m_Distributions[i].length; j++) {
   ((Aggregateable) m_Distributions[i][j])
    .aggregate(toAggregate.m_Distributions[i][j]);
  }
 }
 return this;
}

代码示例来源:origin: Waikato/weka-trunk

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public NaiveBayes aggregate(NaiveBayes toAggregate) throws Exception {
 // Highly unlikely that discretization intervals will match between the
 // two classifiers
 if (m_UseDiscretization || toAggregate.getUseSupervisedDiscretization()) {
  throw new Exception("Unable to aggregate when supervised discretization "
   + "has been turned on");
 }
 if (!m_Instances.equalHeaders(toAggregate.m_Instances)) {
  throw new Exception("Can't aggregate - data headers don't match: "
   + m_Instances.equalHeadersMsg(toAggregate.m_Instances));
 }
 ((Aggregateable) m_ClassDistribution)
  .aggregate(toAggregate.m_ClassDistribution);
 // aggregate all conditional estimators
 for (int i = 0; i < m_Distributions.length; i++) {
  for (int j = 0; j < m_Distributions[i].length; j++) {
   ((Aggregateable) m_Distributions[i][j])
    .aggregate(toAggregate.m_Distributions[i][j]);
  }
 }
 return this;
}

相关文章