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 ; }
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 .