@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; }
@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; }