ContingencyTables.CramersV(matrix)); System.out.println("Entropy of first row: " + ContingencyTables.entropy(firstRow)); System.out.println("Entropy conditioned on columns: " + ContingencyTables.entropyConditionedOnColumns(matrix));
ContingencyTables.CramersV(matrix)); System.out.println("Entropy of first row: " + ContingencyTables.entropy(firstRow)); System.out.println("Entropy conditioned on columns: " + ContingencyTables.entropyConditionedOnColumns(matrix));
/** * Calculates entrpy for given model and data. */ protected double entropy(MM mixtureModel) { double entropy = 0; for (int j = 0; j < m_NumValues; j++) { entropy += m_Weights[j] * ContingencyTables.entropy(Utils.logs2probs(mixtureModel.logJointDensities(m_Values[j]))); } entropy *= Utils.log2; // Need natural logarithm, not base-2 logarithm return entropy / (double)m_NumValues; }
priorEntropy = ContingencyTables.entropy(priorCounts); bestEntropy = priorEntropy;
priorEntropy = ContingencyTables.entropy(priorCounts); bestEntropy = priorEntropy;
/** * Calculates entrpy for given model and data. */ protected double entropy(MM mixtureModel) { double entropy = 0; for (int j = 0; j < m_NumValues; j++) { entropy += m_Weights[j] * ContingencyTables.entropy(Utils.logs2probs(mixtureModel.logJointDensities(m_Values[j]))); } entropy *= Utils.log2; // Need natural logarithm, not base-2 logarithm return entropy / (double)m_NumValues; }
classDstr[0][(int) datum.classValue()] += datum.weight(); defInfo = ContingencyTables.entropy(classDstr[0]); } else { for (int i = 0; i < growData.numInstances(); i++) {