public double classify(Instance inst)
    {
      Instance tInst;

      // fill in missing values
      fillMissing(inst);

      // Conservative
      if (m_classificationMode == CLASSIFICATION_CONSERVATIVE)
      {
        for(int i=0; i < rules.size(); i++)
        {
          tInst = (Instance)rules.elementAt(i);
          if(isGreaterInput(inst, tInst))
          {
            return (tInst.toDoubleArray())[inst.classIndex()];
          }
        }

        return (((Instance)rules.lastElement()).toDoubleArray())
        [inst.classIndex()];
      }
      // Nearest Neightbour
      int cDist = -1;
      int elem = -1;
      if (m_classificationMode == CLASSIFICATION_NEARESTNEIGHBOUR)
      {
        for(int i=0; i < rules.size(); i++)
        {
          tInst = (Instance)rules.elementAt(i);
          if(cDist == -1 || (distance(inst, tInst) < cDist))
          {
            cDist = distance(inst, tInst);
            elem = i;
          }
          if(print_msg)
            System.out.println(((Instance)rules.elementAt(i)).toString() +
                " - " +
                inst.toString() +
                ": Distance is " + distance(inst,tInst));
        }
        if(print_msg)
          System.out.println(((Instance)rules.elementAt(elem)).toString() +
              " is closest to " +
              inst.toString());

        return (((Instance)rules.elementAt(elem)).toDoubleArray())
        [inst.classIndex()];
      }

      return 0;
    }