/** * Construct a new NBNode * * @param header the instances structure of the data we're learning from * @param nbWeightThreshold the weight mass to see before allowing naive Bayes * to predict * @throws Exception if a problem occurs */ public NBNode(Instances header, double nbWeightThreshold) throws Exception { m_nbWeightThreshold = nbWeightThreshold; m_bayes = new NaiveBayesUpdateable(); m_bayes.buildClassifier(header); }
/** * Construct a new NBNode * * @param header the instances structure of the data we're learning from * @param nbWeightThreshold the weight mass to see before allowing naive Bayes * to predict * @throws Exception if a problem occurs */ public NBNode(Instances header, double nbWeightThreshold) throws Exception { m_nbWeightThreshold = nbWeightThreshold; m_bayes = new NaiveBayesUpdateable(); m_bayes.buildClassifier(header); }
/** * Build the no-split node * * @param instances an <code>Instances</code> value * @exception Exception if an error occurs */ public final void buildClassifier(Instances instances) throws Exception { m_nb = new NaiveBayesUpdateable(); m_disc = new Discretize(); m_disc.setInputFormat(instances); Instances temp = Filter.useFilter(instances, m_disc); m_nb.buildClassifier(temp); if (temp.numInstances() >= 5) { m_errors = crossValidate(m_nb, temp, new Random(1)); } m_numSubsets = 1; }
/** * Build the no-split node * * @param instances an <code>Instances</code> value * @exception Exception if an error occurs */ public final void buildClassifier(Instances instances) throws Exception { m_nb = new NaiveBayesUpdateable(); m_disc = new Discretize(); m_disc.setInputFormat(instances); Instances temp = Filter.useFilter(instances, m_disc); m_nb.buildClassifier(temp); if (temp.numInstances() >= 5) { m_errors = crossValidate(m_nb, temp, new Random(1)); } m_numSubsets = 1; }
trainingSets[i].stratify(5); NaiveBayesUpdateable fullModel = new NaiveBayesUpdateable(); fullModel.buildClassifier(trainingSets[i]);
trainingSets[i].stratify(5); NaiveBayesUpdateable fullModel = new NaiveBayesUpdateable(); fullModel.buildClassifier(trainingSets[i]);
trainingSets[i].stratify(5); NaiveBayesUpdateable fullModel = new NaiveBayesUpdateable(); fullModel.buildClassifier(trainingSets[i]);
trainingSets[i].stratify(5); NaiveBayesUpdateable fullModel = new NaiveBayesUpdateable(); fullModel.buildClassifier(trainingSets[i]);