temp *= (weightsByRank[i] / distNorm);
temp *= (m_weightsByRank[i] / distNorm);
  private void updateWeightsNumericClass(int instNum)  {    int i,j;    double temp;    int [] tempSorted = null;    double [] tempDist = null;    double distNorm = 1.0;    // sort nearest neighbours and set up normalization variable    if (weightByDistance)      {	tempDist = new double[m_stored[0]];	for (j=0, distNorm = 0;j<m_stored[0];j++) 	  {	    // copy the distances	    tempDist[j] = m_karray[0][j][0];	    // sum normalizer	    distNorm += weightsByRank[j];	  }	tempSorted = Utils.sort(tempDist);      }    for (i=0;i<m_stored[0];i++)      {	// P diff prediction (class) given nearest instances	if (weightByDistance)	  {	    temp = attributeDiff(m_classIndex, instNum, 				 (int)m_karray[0][tempSorted[i]][1]);	    temp *= (weightsByRank[i] / distNorm);	  }	else	  {	    temp = attributeDiff(m_classIndex,instNum,			     (int)m_karray[0][i][1]);	    temp *= (1.0/(double)m_stored[0]); // equal influence	  }	m_ndc += temp;	// now the attributes	for (j=0;j<m_numAttribs;j++)	  {	    if (j != m_classIndex)	      {		// P of different attribute val given nearest instances		if (weightByDistance)		  {		    temp = attributeDiff(j,instNum,					 (int)m_karray[0][tempSorted[i]][1]);		    temp *= (weightsByRank[i] / distNorm);		  }		else		  {		    temp = attributeDiff(j,instNum,					 (int)m_karray[0][i][1]);		    temp *= (1.0/(double)m_stored[0]); // equal influence		  }		m_nda[j] += temp;		// P of different prediction and different att value given		// nearest instances		if (weightByDistance)		  {		    temp = attributeDiff(m_classIndex, instNum,					 (int)m_karray[0][tempSorted[i]][1]) *		      attributeDiff(j, instNum,				    (int)m_karray[0][tempSorted[i]][1]);		    temp *= (weightsByRank[i] / distNorm);		  }		else		  {		    temp = attributeDiff(m_classIndex,instNum,					 (int)m_karray[0][i][1]) *		      attributeDiff(j,instNum,				    (int)m_karray[0][i][1]);		    temp *= (1.0/(double)m_stored[0]); // equal influence		  }		m_ndcda[j] += temp;			      }	  }      }  }