public int dataPointToCord(DataPointPair<Integer> dataPoint, int targetClass, int[] cord)
    {
        if(cord.length != getDimensionSize())
            throw new ArithmeticException("Storage space and CPT dimension miss match");
        DataPoint dp = dataPoint.getDataPoint();
        int skipVal = -1;
        //Set up cord
        for(int i = 0; i < dimSize.length; i++)
        {
            if(realIndexToCatIndex[i] == targetClass)
            {
                if(targetClass == dp.numCategoricalValues())
                    skipVal = dataPoint.getPair();
                else
                    skipVal = dp.getCategoricalValue(realIndexToCatIndex[i]);
            }
            if(realIndexToCatIndex[i] == predictingIndex)
                cord[i] = dataPoint.getPair();
            else
                cord[i] =  dp.getCategoricalValue(realIndexToCatIndex[i]);
        }
        return skipVal;
    }
public int dataPointToCord ( DataPointPair < Integer > dataPoint , int targetClass , int [ ] cord ) { if ( cord . length != getDimensionSize ( ) ) throw new ArithmeticException ( "Storage space and CPT dimension miss match" ) ; DataPoint dp = dataPoint . getDataPoint ( ) ; int skipVal = - 1 ; for ( int i = 0 ; i < dimSize . length ; i ++ ) { if ( realIndexToCatIndex [ i ] == targetClass ) { if ( targetClass == dp . numCategoricalValues ( ) ) skipVal = dataPoint . getPair ( ) ; else skipVal = dp . getCategoricalValue ( realIndexToCatIndex [ i ] ) ; } if ( realIndexToCatIndex [ i ] == predictingIndex ) cord [ i ] = dataPoint . getPair ( ) ; else cord [ i ] = dp . getCategoricalValue ( realIndexToCatIndex [ i ] ) ; } return skipVal ; }
Converts a data point pair into a coordinate. The paired value contains the value for the predicting index.
Though this value will not be used if the predicting class of the original data set was not used to make the table.

@param dataPoint the DataPointPair to convert
@param targetClass the index in the original data set of the category that we would like to predict
@param cord the array to store the coordinate in.
@return the value of the target class for the given data point
@throws ArithmeticException if the <tt>cord</tt> array does not match the {@link #getDimensionSize() dimension} of the CPT