code: public double query(int targetClass, int targetValue, int[] cord)
      {
          double sumVal = 0; 
          double targetVal = 0;
          int realTargetIndex = catIndexToRealIndex[targetClass];
          
          CategoricalData queryData = valid.get(targetClass);
          
          //Now do all other target class posibilty querys 
          for (int i = 0; i < queryData.getNumOfCategories(); i++)
          {
              
              cord[realTargetIndex] = i;
              
                  
              double tmp =  countArray[cordToIndex(cord)];
              sumVal += tmp;
              if (i == targetValue)
                  targetVal = tmp;
          }
  
          
          return targetVal/sumVal;
      }
docs: Queries the CPT for the probability of the target class occurring with the specified value given the class values of the other attributes
  
  @param targetClass the index in the original data set of the class that we want to probability of
  @param targetValue the value of the <tt>targetClass</tt> that we want to probability of occurring
  @param cord the coordinate array that corresponds the the class values for the CPT, where the coordinate of the <tt>targetClass</tt> may contain any value.
  @return the probability in [0, 1] of the <tt>targetClass</tt> occurring with the <tt>targetValue</tt> given the information in <tt>cord</tt>
  @see #dataPointToCord(jsat.classifiers.DataPointPair, int, int[])