/** Used for combining weighted predictions. */ public RegressionStatBinaryNomiss normalizedCopy() { RegressionStatBinaryNomiss copy = (RegressionStatBinaryNomiss) cloneSimple(); copy.m_NbExamples = 0; copy.m_SumWeight = 1; calcMean(copy.m_Means); return copy; }
/** * Clone this statistic by taking the given weight into account. This is used for example to get * the weighted prediction of default rule. */ public ClusStatistic copyNormalizedWeighted(double weight) { // RegressionStat newStat = (RegressionStat) cloneSimple(); RegressionStatBinaryNomiss newStat = (RegressionStatBinaryNomiss) normalizedCopy(); for (int iTarget = 0; iTarget < newStat.getNbAttributes(); iTarget++) { newStat.m_Means[iTarget] = weight * newStat.m_Means[iTarget]; } return (ClusStatistic) newStat; }