本文整理了Java中weka.classifiers.bayes.NaiveBayes.getUseSupervisedDiscretization()
方法的一些代码示例,展示了NaiveBayes.getUseSupervisedDiscretization()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NaiveBayes.getUseSupervisedDiscretization()
方法的具体详情如下:
包路径:weka.classifiers.bayes.NaiveBayes
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!