protected void computeThresholds(Instances instances){
  int i;
  double[] values;
  int[] sortedIndices;
  int half;
  int quarter;
  double q1;
  double q2;
  double q3;
  m_UpperExtremeValue=new double[m_AttributeIndices.length];
  m_UpperOutlier=new double[m_AttributeIndices.length];
  m_LowerOutlier=new double[m_AttributeIndices.length];
  m_LowerExtremeValue=new double[m_AttributeIndices.length];
  m_Median=new double[m_AttributeIndices.length];
  m_IQR=new double[m_AttributeIndices.length];
  for (i=0; i < m_AttributeIndices.length; i++) {
    if (m_AttributeIndices[i] == NON_NUMERIC) {
      continue;
    }
    values=instances.attributeToDoubleArray(m_AttributeIndices[i]);
    sortedIndices=Utils.sort(values);
    half=sortedIndices.length / 2;
    quarter=half / 2;
    if (sortedIndices.length % 2 == 1) {
      q2=values[sortedIndices[half]];
    }
 else {
      q2=(values[sortedIndices[half]] + values[sortedIndices[half + 1]]) / 2;
    }
    if (half % 2 == 1) {
      q1=values[sortedIndices[quarter]];
      q3=values[sortedIndices[sortedIndices.length - quarter - 1]];
    }
 else {
      q1=(values[sortedIndices[quarter]] + values[sortedIndices[quarter + 1]]) / 2;
      q3=(values[sortedIndices[sortedIndices.length - quarter - 1]] + values[sortedIndices[sortedIndices.length - quarter]]) / 2;
    }
    m_Median[i]=q2;
    m_IQR[i]=q3 - q1;
    m_UpperExtremeValue[i]=q3 + getExtremeValuesFactor() * m_IQR[i];
    m_UpperOutlier[i]=q3 + getOutlierFactor() * m_IQR[i];
    m_LowerOutlier[i]=q1 - getOutlierFactor() * m_IQR[i];
    m_LowerExtremeValue[i]=q1 - getExtremeValuesFactor() * m_IQR[i];
  }
}

protected void computeThresholds ( Instances instances ) { int i ; double [ ] values ; int [ ] sortedIndices ; int half ; int quarter ; double q1 ; double q2 ; double q3 ; m_UpperExtremeValue = new double [ m_AttributeIndices . length ] ; m_UpperOutlier = new double [ m_AttributeIndices . length ] ; m_LowerOutlier = new double [ m_AttributeIndices . length ] ; m_LowerExtremeValue = new double [ m_AttributeIndices . length ] ; m_Median = new double [ m_AttributeIndices . length ] ; m_IQR = new double [ m_AttributeIndices . length ] ; for ( i = 0 ; i < m_AttributeIndices . length ; i ++ ) { if ( m_AttributeIndices [ i ] == NON_NUMERIC ) { continue ; } values = instances . attributeToDoubleArray ( m_AttributeIndices [ i ] ) ; sortedIndices = Utils . sort ( values ) ; half = sortedIndices . length / 2 ; quarter = half / 2 ; if ( sortedIndices . length % 2 == 1 ) { q2 = values [ sortedIndices [ half ] ] ; } else { q2 = ( values [ sortedIndices [ half ] ] + values [ sortedIndices [ half + 1 ] ] ) / 2 ; } if ( half % 2 == 1 ) { q1 = values [ sortedIndices [ quarter ] ] ; q3 = values [ sortedIndices [ sortedIndices . length - quarter - 1 ] ] ; } else { q1 = ( values [ sortedIndices [ quarter ] ] + values [ sortedIndices [ quarter + 1 ] ] ) / 2 ; q3 = ( values [ sortedIndices [ sortedIndices . length - quarter - 1 ] ] + values [ sortedIndices [ sortedIndices . length - quarter ] ] ) / 2 ; } m_Median [ i ] = q2 ; m_IQR [ i ] = q3 - q1 ; m_UpperExtremeValue [ i ] = q3 + getExtremeValuesFactor ( ) * m_IQR [ i ] ; m_UpperOutlier [ i ] = q3 + getOutlierFactor ( ) * m_IQR [ i ] ; m_LowerOutlier [ i ] = q1 - getOutlierFactor ( ) * m_IQR [ i ] ; m_LowerExtremeValue [ i ] = q1 - getExtremeValuesFactor ( ) * m_IQR [ i ] ; } }
computes the thresholds for outliers and extreme values
